I am a little bit confused at the way prefect treats mapping. If you map to an empty list/tuple do no child tasks get created and the task is skipped? Or is are all child tasks failed automatically?
k
Kevin Kho
02/25/2022, 1:53 AM
I think the task is skipped but you can still trigger downstream
Copy code
from prefect import Flow, task, unmapped
@task
def task_a(x):
return x+1
@task
def task_b(x):
return x+1
with Flow("...") as flow:
a = task_a.map([])
b = task_b.map([0,1,2], upstream_tasks=[unmapped(a)])
flow.run()
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.