Aiden Price
08/04/2021, 2:32 AMkwargs
for the next task downstream?
Something like;
# returns {"path": "some/restapi/path", "start_time": datetime...}
tasks = generate_tasks(first_set)
# Needs a path and start_time argument
histories = fetch_history.map(**tasks)
But this gives me the error expression after ** must be a mapping with a "str" key
Kevin Kho
x[0]
are evaluated during build time, when that Task
hasn't resolved yet which causes this error. So you can't perform stuff like tuple unpacking because the values don't exist during build time.
You either need an intermediate task to plug out the values, or pass the whole dictionary, but something seems off here. If you perform the map
, it has to be over a list. If you are supplying a kwarg
that is the same for all mapped tasks, you mapped need to wrapped it with unmapped
.Aiden Price
08/04/2021, 2:46 AMmap
call when I simplified my example. In actuality I'm returning a list of dictionaries and wanted to unpack each in the map
.Kevin Kho
Aiden Price
08/04/2021, 2:47 AM