https://prefect.io logo
Title
j

Jason Noxon

05/02/2023, 12:21 PM
Good morning! Is there a way to pass parameters in a
Deployment.build_from_flow()
deployment method? I tried adding a dictionary called
parameters=
to the call, but no love.
v

Vadym Dytyniak

05/02/2023, 12:26 PM
Works for me:
deployment = Deployment.build_from_flow(
    flow=flow,
    schedule=schedule,
    parameters=parameters,
    name=name,
    storage=storage,
    work_queue_name=work_queue.value,
    path=path,
    infrastructure=infrastructure,
    tags=tags,
    skip_upload=True,
)
j

Jason Noxon

05/02/2023, 12:27 PM
Yeah, that's what I am trying - but the parameters don't show up in the UI for that deplyoment. Is the parameters field a dictionary?
v

Vadym Dytyniak

05/02/2023, 12:29 PM
Yeah, parameters is a dict. Do you call apply on deployment?
j

Jason Noxon

05/02/2023, 12:29 PM
I haven't been, and it deploys to the server. Let me try that!
v

Vadym Dytyniak

05/02/2023, 12:30 PM
deployment = Deployment.build_from_flow(
    flow=flow,
    schedule=schedule,
    parameters=parameters,
    name=name,
    storage=storage,
    work_queue_name=work_queue.value,
    path=path,
    infrastructure=infrastructure,
    tags=tags,
    skip_upload=True,
)
deployment.apply()
j

Jason Noxon

05/02/2023, 12:34 PM
It work when I actually ran the deployed flow - still did not apply, buy have apply=True in the function call. Thanks for your help, @Vadym Dytyniak!
v

Vadym Dytyniak

05/02/2023, 12:36 PM
np