Daniel Suissa
12/01/2021, 3:57 PMDaniel Suissa
12/01/2021, 3:59 PMKevin Kho
flow.run()
is not meant for production so you need to register the subflows and then trigger them with the StartFlowRun
or create_flow_run
task like thisKevin Kho
@task
def abc():
return 1
@task
def bcd():
abc.run()
but the abc
in bcd
is no longer a task. it’s like a regular Python function so you don’t get observabilityDaniel Suissa
12/01/2021, 4:23 PMDaniel Suissa
12/01/2021, 4:25 PMKevin Kho
Daniel Suissa
12/01/2021, 4:29 PMDaniel Suissa
12/01/2021, 4:30 PMKevin Kho
@task
def plus_one(x):
return x+1
with Flow("name") as flow:
a = plus_one(1)
b = plus_one(a)
This will implicitly build the dependencies for you and pass the value of a
in memoryKevin Kho
with Flow(...) as flow:
a = first_task()
b = second_task()
c = third_task(c_inputs, upstream_tasks=[a,b])
or
with Flow("ex") as flow:
a = first_task()
b = second_task(upstream_tasks=[a])
c = third_task(upstream_tasks=[b])
if there is no data dependencyDaniel Suissa
12/01/2021, 4:44 PMKevin Kho