https://prefect.io logo
Title
m

Marc-Antoine Bélanger

09/08/2022, 12:41 AM
I have some issues specifying the parameters on a deployment run. I have defined the following properties:
{"data": {
                        "title": "data",
                        "default": {},
                        "type": "object",
 },
"train": {
                        "title": "train",
                        "default": {},
                        "type": "object",
 }
}
This is what it is showing in the UI: But the run fails:
Validation of flow parameters failed with error: ParameterTypeError('Flow run received invalid parameters:\n - data: value is not a valid dict\n - train: value is not a valid dict')
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 284, in retrieve_flow_then_begin_flow_run
    parameters = flow.validate_parameters(flow_run.parameters)
  File "/usr/local/lib/python3.10/site-packages/prefect/flows.py", line 269, in validate_parameters
    raise ParameterTypeError.from_validation_error(exc) from None
prefect.exceptions.ParameterTypeError: Flow run received invalid parameters:
 - data: value is not a valid dict
 - train: value is not a valid dict
They seem to be interpreted as strings in the Parameters tab:
{
  "data": "{}",
  "train": "{}"
}
Any idea what I am doing wrong?
r

Rob Freedy

09/09/2022, 7:39 PM
have you tried using something like this to set the dict as a parameter?
dict({"data": {
                        "title": "data",
                        "default": {},
                        "type": "object",
 },
"train": {
                        "title": "train",
                        "default": {},
                        "type": "object",
 }
})