#986 Set upstream node for branch node
Pull request opened by pingsutw
Signed-off-by: Kevin Su pingsutw@apache.orgTL;DR
We didn't set the upstream node for the branch node. Therefore, the DAG of the following example is wrong,
from flytekit import task, workflow, conditional
@task
def square(n: float) -> float:
return n * n
@task
def double(n: float) -> float:
return 2 * n
@task
def t1() -> float:
return 3.0
@workflow
def wf(my_input: float) -> float:
val = t1()
return (
conditional("fractions")
.if_((my_input >= 0.1) & (my_input <= 1.0))
.then(double(n=val))
.else_()
.then(square(n=my_input))
)
Before: