https://prefect.io logo
p

Pedro Machado

01/24/2022, 6:11 PM
Hi again. Is there an idiom to run mapped tasks respecting the order of the item in the sequence? I believe I can use
LocalExecutor
and it will run them in order but was wondering if there is a way to explicitly define the dependencies. For example, in this case, I'd like to make sure that the mapped task for 2 runs after 1 and 3 runs after 3.
Copy code
items = [1, 2, 3]
ny_task.map(items)
thanks
k

Kevin Kho

01/24/2022, 6:14 PM
If you are using a map, you can’t. But if you know
items
beforehand and it’s not a task output, you can do this
Use a for loop to construct your dag
p

Pedro Machado

01/25/2022, 1:15 PM
Thanks!
3 Views