Hi i have a problem when i define three task and add call them one by one under a flow they didn't run step by step !! how can i say to a flow to how run task (which task 1st which one 2nd and which one 3rd) ???
I'm adding a sample code as an reply to my message
a
Anna Geller
12/07/2021, 11:41 AM
@alins if you pass data dependencies, then you don’t need to set this at all. But if you don’t pass data, then:
Method 1:
Copy code
with Flow(...) as flow:
a = first_task()
b = second_task()
c = third_task(c_inputs, upstream_tasks=[a,b])
Method 2:
Copy code
from prefect import task, Flow
@task
def first_task():
pass
@task
def second_task():
pass
@task
def third_task():
pass
with Flow("ex") as flow:
a = first_task()
b = second_task(upstream_tasks=[a])
c = third_task(upstream_tasks=[b])
flow.visualize()
a
alins
12/07/2021, 11:45 AM
Copy code
thanks @Anna Geller I will test you method and tell you if its work tnx again :heart:
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.