Krystal
06/21/2024, 9:58 AMprefect.yaml
with prefect deploy
does not work with pydantic class parameters. The UI is not showing the default values for the class fieldsMarvin
06/21/2024, 9:58 AMprefect.yaml
where the UI does not show default values for Pydantic class parameters. This appears to be a known issue with how Prefect handles defaults and parameter syncing within the deployment framework.
#### Documentation Insights
1. Deployment Mechanics: When deploying with prefect.yaml
, the handling of parameters and blocks follows a specific sequence. Parameters specified in prefect.yaml
should align with what the flow function expects. Defaults for deployment parameters can typically be edited directly in the Prefect UI. Prefect Deployment Documentation
2. Parameter Configuration: You may specify parameters in the prefect.yaml
as JSON key-value pairs. Ensure that these values match the expected parameters of your flow function. Details on deployment.yaml Configuration
#### Related GitHub Issues
1. Boolean flow parameter defaults to False in UI when no default is given in code
2. Prefect Variables as Defaults in Pydantic Models
3. Flow run - custom run - Literal with string values and None, None is not allowed in dropdown - new UI
### Workaround and Recommendations
1. Explicit Defaults: Define the default values explicitly in your prefect.yaml
to ensure they are picked up by the deployment process:
yaml
parameters:
param1: "default_value_1"
param2: "default_value_2"
2. Parameter Editing in UI: You might need to manually set or adjust parameters in the Prefect UI after deployment:
- Navigate to the deployment details page.
- Select Edit from the commands menu and adjust the parameter values.
3. Testing and Verification: It's good practice to run a few test deployments and verify the parameter values in both the prefect.yaml
and the Prefect UI.
Hope this helps. Feel free to ask for more assistance!