John Faucett
03/31/2020, 1:31 PMflow = Flow('foo', tasks=[t1,t2,t3, t4])
flow.add_edge(t1,t2, key='x')
flow.add_edge(t2,t3)
flow.add_edge(t3,t4)
# now t4 needs the results of t1 not t2 or t3
Jeremiah
03/31/2020, 1:55 PMt1 →t2
edge using a key. For example, flow.add_edge(t1, t4, key='y')
John Faucett
03/31/2020, 1:57 PMJeremiah
03/31/2020, 1:58 PMadd_edge
is the lowest level API for setting dependencies and may skip some checks that higher level APIs perform (for example, handling constant values without wrapping them as tasks). You might opt for flow.set_dependencies(t4, keyword_tasks={'y':t1})
or even the task’s own method`t4.set_upstream(t1, flow=flow, key='y')` . To be clear your way will work as expected for your example, but using the slightly higher-level APIs might future proof you a little better if more robust checks are introduced.t4
depends on t1
and t3
, whether passing data or just a state edge, it will wait for them all to finish.John Faucett
03/31/2020, 2:03 PMJeremiah
03/31/2020, 2:03 PMjosh
04/02/2020, 1:23 PMMarvin
04/02/2020, 1:23 PM