<@ULVA73B9P> what package would have caused prefec...
# ask-marvin
y
@Marvin what package would have caused prefect version 2.14.21 to have problem deploying flows on cli
Copy code
File “/var/opt/20240712080812-3a616065/.venv/lib/python3.11/site-packages/prefect/cli/deploy.py”, line 274, in deploy
    for name in names:
TypeError: ‘NoneType’ object is not iterable
@Marvin why is the prefect cli not reading my prefect.yaml file correctly
m
The issue you're encountering with Prefect version 2.14.21 when deploying flows using the CLI appears to be related to the
typer
package. Specifically, a recent update to
typer
(version 0.10.0) changed some default behaviors, which can result in a
NoneType
being assigned to options when none are provided. This causes errors like “TypeError: ‘NoneType’ object is not iterable” during flow deployment. You can refer to the relevant GitHub issue for more details: new `typer` seems to break our CLI. To resolve this, you can pin the
typer
package to a version below 0.10.0 in your
requirements.txt
or
pyproject.toml
to prevent this issue from occurring.
The issue you're encountering with Prefect version 2.14.21 during flow deployment seems to be caused by the
typer
package update to version 0.10.0. Here's a brief explanation: - In
typer
version 0.10.0, the default behavior changed, leading to certain options being set to
None
instead of an empty list if not explicitly provided. - When
typer
assigns
None
to an option that is expected to be a list, it results in a
TypeError: ‘NoneType’ object is not iterable
error. You can address this by pinning the
typer
package to a version below 0.10.0 in your
requirements.txt
or
pyproject.toml
file. For more details, you can check the related GitHub issue here: new `typer` seems to break our CLI.
Here are a few potential reasons why the Prefect CLI might not be reading your
prefect.yaml
file correctly: 1. Incorrect File Location or Name: The Prefect CLI command must be run from the project root, and paths inside
prefect.yaml
must be relative to the project root. The
prefect.yaml
file can be located in a different directory or named differently if you use the
--prefect-file
option. Example:
Copy code
prefect deploy --prefect-file ../prefect2.yaml --all
2. File Parsing and Structure: Make sure that your
prefect.yaml
file is correctly structured and formatted. Sometimes, minor issues in the YAML file can lead to it not being read properly. 3. Overriding Options: Any configuration in
prefect.yaml
can be overridden by options provided in the
prefect deploy
command. Ensure there are no conflicts between your CLI options and what you have in the YAML file. 4. Prefect Version: Ensure you are using a Prefect version that supports the features of
prefect.yaml
. For more details, see: - Prefect deployment guide: Prefect Deployment Guide - Related GitHub issue on custom `prefect.yaml`: GitHub PR #11511 If these suggestions do not resolve your problem, please share specific details about what seems to be missed or not parsed correctly, and I can provide further assistance.
The error you encountered is caused by the
typer
package. Specifically, the update to
typer
version 0.10.0 introduced changes that can result in options being set to
None
instead of an empty list if not explicitly provided. This leads to the
TypeError: ‘NoneType’ object is not iterable
error when you run the
prefect deploy
CLI command. To resolve this, you should pin the
typer
package to a version below 0.10.0. You can do this by adding or updating the
typer
dependency in your
requirements.txt
or
pyproject.toml
file. Relevant GitHub issue: new `typer` seems to break our CLI.