Martim Lobao
11/04/2021, 4:24 PMand
(the output of each task is a bool), but it looks like prefect started the child task when the first parent finished instead of waiting for both:
FIRST_TASK_DONE = first_task()
SECOND_TASK_DONE = second_task()
THIRD_TASK_READY = FIRST_TASK_DONE and SECOND_TASK_DONE
third_task(third_task_ready=THIRD_TASK_READY)
third_task
was supposed to only start after both first_task
and second_task
had finished, but instead it only waited for the first one to completeKevin Kho
with Flow(...) as flow:
a = first_task()
b = second_task()
c = third_task(c_inputs, upstream_tasks=[a,b])
Martim Lobao
11/04/2021, 4:30 PMKevin Kho
upstream_tasks
will work yeah. If a
and b
are mapped, you may need to wrap them with unmapped
inside the listMartim Lobao
11/04/2021, 4:31 PMMartim Lobao
11/04/2021, 4:31 PMKevin Kho
with Flow(...) as flow:
a = first_task()
b = second_task()
c = third_task()
c.set_upstream(b)
c.set_upstream(a)
Martim Lobao
11/04/2021, 4:35 PMupstream_tasks
is an argument of set_dependencies
Martim Lobao
11/04/2021, 4:37 PMKevin Kho
run()
method of tasksMartim Lobao
11/04/2021, 4:39 PM