state = flow.run(
account_uuid=527132950,
start_date="2020-11-01",
email_domain="",
end_date=None,
to_list=["<mailto:jeff.newburn@logikcull.com|jeff.newburn@logikcull.com>"],
)
Error:
Copy code
TypeError: run() got an unexpected keyword argument 'account_uuid'
Can someone help me understand what is going on here? Why do Parameters have to be used in a flow for the flow not to explode?
k
Kevin Kho
09/06/2021, 5:48 PM
flow.run()
has a dict for parameters.
flow.run(parameters={'account_uuid': 527132950})
. You can set
Parameter(name="xxx", required=False)
j
Jeffery Newburn
09/06/2021, 6:05 PM
I am a bit confused. I am passing in all the required parameters and the flow works as long as all the parameters are used in tasks. But in the example if the flow doesn’t use the parameters in some task it gets an error for the keyword arguments.
k
Kevin Kho
09/06/2021, 7:59 PM
Ah I know what you mean now. I would need to ask some other team members tomorrow since today is a holiday
j
Jeffery Newburn
09/06/2021, 8:09 PM
Cool It isn’t critical just seems really odd.
k
Kevin Kho
09/07/2021, 8:08 PM
Hey, this is because the task is being created but not called.
Parameter()
creates it, but passing it somewhere is the one that actually calls it. Without using it, the Parameter doesn’t get registered because it’s a task that wasn’t used.
To avoid this, you might be able to do:
Copy code
with Flow("ROI Report Generator") as flow:
start_date = Parameter(name="start_date")()
end_date = Parameter(name="end_date")()
Kevin Kho
09/07/2021, 8:08 PM
Only tasks that are called end up being registered
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.