https://prefect.io logo
Title
m

Maxime Lavoie

03/31/2020, 5:54 PM
Anyone could help me with this seemingly simple hurdle? I have
with Flow("My Flow") as flow:
    my_param = Parameter("my_param", default='a default value')
    ...

flow.run()
# flow.run(parameters={"my_param": "overwritten value"})
When I run this, I get
raise ValueError(
ValueError: Flow.run received the following unexpected parameters: my_param
What am I missing?
k

Kyle Moon-Wright

03/31/2020, 6:16 PM
Hey Maxime, It looks like the parameter you created was never added to the flow, instantiating a task doesn’t necessarily add it to the flow. Be sure to add the task (all parameters are tasks) to the flow using the
flow.add_task()
or the
flow.set_dependencies(task=task_name)
method. More information can be found here: https://docs.prefect.io/core/advanced_tutorials/task-guide.html#adding-tasks-to-flows
m

Maxime Lavoie

03/31/2020, 6:35 PM
@Kyle Moon-Wright, thanks!
đź‘Ť 1
j

josh

04/02/2020, 1:25 PM
@Marvin archive “Flow run received the following unexpected parameters”