I am a little bit confused at the way prefect trea...
# prefect-community
h
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
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()