Qwame
08/09/2020, 9:06 AMF1 >> [f2, f3, f4, f5, f6]
What's the best way to set these dependencies in Prefect. I notice that set_downstream doesn't accept a list of tasks. Is there any efficient way to do this in Prefect?
Also does the new Prefect UI mean I don't need docker to run it?
Thanksnicholas
upstream_tasks
or downstream_tasks
task constructor, or using the set_dependencies
method like such:
from prefect import Flow, task
@task
def F1():
print("F1")
return
@task
def f2():
print("f2")
@task
def f3():
print("f3")
with Flow("F Flow") as flow:
f1 = F1()
f2(upstream_tasks=[f1])
f3(upstream_tasks=[f1])
or:
from prefect import task, Flow
@task
def F1():
print("F1")
@task
def f2():
print("f2")
@task
def f3():
print("f3")
with Flow("F Flow") as flow:
F1.set_dependencies(downstream_tasks=[f2, f3])
nicholas
Qwame
08/10/2020, 1:34 AMnicholas
Qwame
08/10/2020, 1:44 AMQwame
08/10/2020, 1:48 AMF1.set_dependencies(downstream_tasks=[f2, f3])
I didn't know we could call the set_dependencies without doing the above first.nicholas
Qwame
08/10/2020, 6:24 AMArchie35
10/06/2020, 10:36 PMQwame
10/07/2020, 12:24 AM