Kaleb King
01/21/2024, 6:09 PMMarvin
01/21/2024, 6:10 PMNone
if not explicitly set. You would have to check for parameter existence at the beginning of your flow run with custom validation logic.
2. When defining the deployment, you can specify a parameter_openapi_schema
to enforce a particular schema for parameters used in flow runs. To ensure that the Prefect API checks the parameter values against the provided schema, set enforce_parameter_schema
to true
in your deployment configuration.
For ad-hoc runs with different parameter values:
- Go to the details page for a deployment.
- Select "Run", then "Custom".
- You will be able to provide custom values for any editable deployment fields.
- Under Parameters, select "Custom".
- Provide the new values and then select "Save".
- Select "Run" to begin the flow run with custom values.
Find more information in the Prefect documentation here.
Please be aware that when you set enforce_parameter_schema
to true
, all future flow runs based on that deployment will require the parameter values to pass the schema validation, thus effectively making some parameters required.Nate
01/21/2024, 6:55 PM@flow
def foo(required: str, not_required: str | None = None):
pass
if __name__ == "__main__":
foo.serve(__file__)