For prefect mapping, is it possible to revert back...
# prefect-community
b
For prefect mapping, is it possible to revert back to the old 'breath first' behavior?
c
Hi Bob, while there isn’t a first-class API for toggling this behavior, you can enforce breadth first by adding a “dummy” task at each level of your mapped pipeline:
Copy code
level_one = task_one.map(some_list)
one_wait = Task(name="Level 1 Block")(upstream_tasks=[level_one])

level_two = task_two.map(some_other_list, upstream_tasks=[one_wait])
Task(name="Level 2 Block")(upstream_tasks=[level_two])
etc.
Coincidentally, someone else asked for this only a few hours ago: https://prefect-community.slack.com/archives/CL09KU1K7/p1603115121236400
b
cool, thanks Chris. Will be great to expose this as a parameter option in the future
👍 1
m
An even simpler approach seems to be working for me. Am I overlooking something?
Copy code
level_one = task_one.map(some_list)

level_two = task_two.map(some_other_list, upstream_tasks=[level_one])
c
Ah that’s great! The middle task is unnecessary - you can set the dependency directly, nice
🎉 1