Fina Silva-Santisteban
06/18/2024, 7:27 PMprefect deployment run 'file-name/flow-name'
I'm now trying to do a local deployment again but receive this error message whenever I try:
cli_params = _load_json_key_values(params, "parameter")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fina/.local/share/virtualenvs/flow-dGAJ-ukb/lib/python3.11/site-packages/prefect/cli/deployment.py", line 1282, in _load_json_key_values
for spec in cli_input:
TypeError: 'NoneType' object is not iterable
It seems like the cli command thinks it received a 'params' flag and that its contents are Null, when in fact it didn't.
Does anyone have any ideas about what might be going on?? 🙏Dev Dabke
06/18/2024, 7:32 PMprefect deployment run --help
Dev Dabke
06/18/2024, 7:33 PM--param
flag or --params
flagDev Dabke
06/18/2024, 7:33 PMFina Silva-Santisteban
06/18/2024, 7:35 PMif __name__ == "__main__":
with open('flow_params_for_local_run.json',
encoding='utf-8') as file:
data = json.load(file)
flow.serve(name="local-flow-deployment",
parameters={"param1": 'value1',
"param2":
'value2'})
(Using dummy values for the params in this message). The simple command
prefect deployment run 'file-name/flow-name'
used to work a few months ago, and now it doesn't. That's the issueDev Dabke
06/18/2024, 7:37 PM.serve
is only setting the default parametersDev Dabke
06/18/2024, 7:39 PMflow.serve(parameters={}
, you are setting the default values for the params, e.g., you are specifying that param1
should have default value `value`` . When you invoke a deployment with prefect deployment run
you can still pass params to the deployment.Dev Dabke
06/18/2024, 7:39 PMdeployment run
is the thing that actually runs itDev Dabke
06/18/2024, 7:40 PMNate
06/18/2024, 7:45 PMtyper
problem
@Fina Silva-Santisteban can you do pip list | grep -E 'prefect|typer'
?Nate
06/18/2024, 7:46 PMNone
, hence the NoneType
not iterable - which we've fixed in newer versions of prefectFina Silva-Santisteban
06/18/2024, 7:46 PMFina Silva-Santisteban
06/18/2024, 7:47 PMFina Silva-Santisteban
06/18/2024, 7:50 PMtyper 0.12.3
Oh no, does this mean that I need to update the prefect version??Nate
06/18/2024, 7:51 PMprefect
, you should be able to downgrade typer
this issue breaksandprefect deploy
in all scenarios where a user does not haveprefect deployment run
pinned belowtyper
0.10.0
Fina Silva-Santisteban
06/18/2024, 7:54 PMNate
06/18/2024, 7:55 PMFina Silva-Santisteban
06/18/2024, 7:58 PMtyper = "==0.9.4"
in my pipfile and now things work fine again! Thanks a lot 🙏Nate
06/18/2024, 7:58 PMNate
06/18/2024, 7:58 PM