Igor Morgunov09/06/2022, 4:57 PM
My problem is that
@task() def task1(): # do stuff @task() def task2(): # do other stuff ids = ['aaa', 'bbb', 'ccc'] for id in ids: x = task1() y = task2(upstream_tasks=[x]) flow.run(executor=LocalDaskExecutor)
fires when the first instance of
completes successfully - I need
to fire only once all of
instances have completed - what am I doing wrong here?
Barada Sahu09/06/2022, 5:08 PM
Nate09/06/2022, 6:38 PM
instead of a for loop and you need to define your flow as a `with Flow() as flow:`context manager if prefect 2, there is no longer a concept of an
, you'd want to use the
is indeed what you want if prefect 2, and
is what you want for prefect 1.
Igor Morgunov09/07/2022, 8:40 AM