Jacob Blanco
11/01/2024, 2:38 AMAdd parameters to your flow definitions to make them reusable and configurable. Learn more
Or {}
in the current run page.
The flow signature looks like this:
@flow(name="Application Events")
def application_events(kafka_params: KafkaIngestionParams = KafkaIngestionParams()):
I can share the model definition but it contains a bool
and an int
with simple hardcoded values.
I would expect to see something like this with the default values:
{ "param_a": 5, "param_b": true }
Nate
11/01/2024, 2:34 PMprefect deployment inspect your-flow/your-deployment
Jacob Blanco
11/05/2024, 1:03 AMJacob Blanco
11/05/2024, 1:12 AMJacob Blanco
11/05/2024, 2:08 AMdef my_flow(params: AllOptionalsModel):
or
b)
def my_flow(params: OneRequiredModel = OneRequiredModel()):
Or something else?
If I do a, I get an error stating that params
is required and not provided even if all parameters there in are optional. If I do b I get an error because one of the fields are required when I construct OneRequiredModel
so I'm not sure which is the correct approach.
I think I may have the wrong mental framework for these Models. To my mind they act as a container of parameters, however it seems that Prefect thinks of them as just another kind of parameter. For me it's not meaningful to say that "the Model itself has default values" or that the "model is optional/required" in a way that's independent of the default values (if any) of it's constituent fields.Jacob Blanco
11/12/2024, 1:50 AM