Wu Da-Yi
10/23/2023, 4:01 AMb>>a
then need to run b first, then a. even in python code a is defined before than b.
Everything works well with dfs/topological sort, sorting the node, execute the node one-by-one, until i deal with BranchNode. Normally, task or other nodes can be excuted by node.flyte_entity
and get_promise_map
. However, BranchNode seems not follow this rules. The root cause is that the BranchNode._ifelse_block
is already a FlyteIdlEntity
that make it really hard to call in python. I am trying to solve this problem by adding a __call__
function in BranchNode
and add the python callable object ConditionalSection
as a new attribute into BranchNode, I dont know if this is a correct direction to work on. Do anyone know about this?Ketan (kumare3)
Wu Da-Yi
10/23/2023, 4:47 AMconditional
visit all branches using start_branch
and end_branch
function, and then write itself into branchnode using to_branch_node
. So actually, all the state are written in Branchnode. The whole problem just branchnode have no good interface for python execution. (conditional
, on the other hand, is good for python execution ). Not sure if it is a good solution just write conditional into the branchnode attribute)Samhita Alla
Wu Da-Yi
10/24/2023, 9:30 AMfail
in branchnode. When I am trying to execute the fail
cases using pyflyte remote run. Remote also not shwoing the err meesage I type in python.
@workflow
def wf1(my_input: float):
return conditional("fractions")
.if_((my_input > 0.1) & (my_input < 1.0))
.then(double(n=my_input))
.else_()
.fail("The input must be between 0 and 10")
)
if we sent my_input = 11.0 . there is no correct message shown in flyte remote.("The input must between 0 and 10")
[MalformedBranchUserError] No branch satisfied
is shown in flyte remote insteadKevin Su
10/27/2023, 7:20 AM