Ying Ting Loo
07/12/2024, 9:16 AMFile “/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
Ying Ting Loo
07/12/2024, 9:17 AMMarvin
07/12/2024, 9:20 AMtyper
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.Marvin
07/12/2024, 9:22 AMtyper
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.Marvin
07/12/2024, 9:23 AMprefect.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:
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.Marvin
07/12/2024, 10:19 AMtyper
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.