https://prefect.io logo
Title
n

Nils

01/11/2023, 1:24 PM
Is it possible to pass a pydantic model as parameter to
run_deployment
? I have a setup similar to the following, but when I pass the pydantic model I get some weird behavior.
class Config(BaseModel):
   ...

@flow(name="subflow")
def subflow(config: Config = Config()):
    do_something()

@flow
def main_flow(config: Config = Config()):
    run_deployment(name="subflow", parameters={"config": config})
j

Jean Luciano

01/11/2023, 2:40 PM
It takes in a dictionary but you can convert pydantic model with
model.dict()
.
n

Nils

01/11/2023, 2:47 PM
The subflow expects a pydantic model instead of a dict though, is that a problem?