<@ULVA73B9P> I am using a pydantic model for the f...
# ask-marvin
k
@Marvin I am using a pydantic model for the flow parameters but somehow the UI is not displaying any of the fields and it's just an empty dictionary when my fields all have default values. What is the problem?
m
It seems there is an open issue on the Prefect GitHub repository related to difficulties with pydantic model default values not accurately displaying in the UI. Here's a brief summary: ### Bug Summary - The UI displays the default parameters of the pydantic model itself rather than the default value for the flow parameter. - When executing the flow via the "Run" button, the flow uses the default value of the flow parameter, causing a discrepancy between the UI and the actual execution. - It becomes confusing for users and can prevent them from submitting a flow with the desired parameters. ### Reproduction Example A user provided an example where defining a flow with a default parameter as
Param(a=2)
shows
a=1
in the UI but executes with
a=2
. For more details, you can refer to the GitHub issue #9018 on the Prefect repository. There is not a direct solution provided within the issue. You might want to subscribe to that issue to get updates when there is a fix. Meanwhile, ensure you have the latest Prefect version and consider working around the issue by not relying on pydantic models for default parameter values in the UI.