Matija
07/25/2024, 4:45 PMMarvin
07/25/2024, 4:45 PMvalue is not a valid list (type=type_error.list)
usually occurs when a field expected to be a list in the deployment configuration is not provided as such. This might be related to one of the parameters in your deployment where a list is expected.
In your script, you're using Deployment.build_from_flow
which is deprecated. You should use Flow.deploy()
instead. This is likely not the direct issue, but it's good to use updated methods.
Here’s an example of how you could modify your deploy.py
script:
python
from prefect.deployments import Deployment
from prefect.filesystems import AzureBlobStorage
azure_blob_storage_container_block = AzureBlobStorage.load("rai-default-flows-storage")
deployment = Deployment.build_from_flow(
flow=run_spider,
name="price-scrap",
work_pool_name="default-agent-pool",
work_queue_name="product-scrap",
storage=azure_blob_storage_container_block,
apply=True,
path="price-scrap-store-4",
)
deployment.apply()
Make sure that all parameters that are expected to be lists (such as command
in some job configuration) are provided as lists. For example, in shell commands ensure they are listed properly:
python
commands = ["command1", "command2"]
Further references:
- GitHub Issue on similar error
If you follow this and ensure proper parameter passing, it should resolve the validation error.
Would you like more detailed assistance on a specific part or more debugging tips?