https://prefect.io logo
Title
t

Tim Enders

01/21/2022, 9:04 PM
My brain is fried (yay Friday) and I can't seem to find this in the documentation. But how do I specify an upstream task explicitly when using the
with Flow() as flow:
pattern?
k

Kevin Kho

01/21/2022, 9:05 PM
Like this?
with Flow(...) as flow:
    a = task_a()
    b = task_b(upstream_tasks=[a])
t

Tim Enders

01/21/2022, 9:06 PM
thank you. I was looking for a function/method call
k

Kevin Kho

01/21/2022, 9:06 PM
with Flow(...) as flow:
    a = task_a()
    b = task_b()
    b.set_upstream(a)
t

Tim Enders

01/21/2022, 9:07 PM
ok, so I can do it either way? Brilliant!
k

Kevin Kho

01/21/2022, 9:09 PM
Yeah