Hi flyte comm, i am testing out the conditional st...
# flytekit
j
Hi flyte comm, i am testing out the conditional statement in workflow and noticed that return values of the conditional values are in reverse order. For example:
Copy code
@workflow
def child_workflow(username: str) -> tuple[str, str]:
    hello_output = hello(username=username)
    hello_output1 = hello(username="child_wf")
    return hello_output, hello_output1

@workflow
def parent_workflow(in1: int, input_value: str) -> tuple[str, str]:
    run_wf = dummy_bool(in1=in1)

    return (conditional("run_wf")
                .if_(run_wf == True)
                .then(child_workflow(username=input_value))
                .else_()
                .then(child_workflow2(username="conditional_clause")))
if one of the task returns this
return "Jay", "child_wf1"
then the workflow with conditional is returning
Copy code
o0: Hello, child_wf!
o1: Hello, Jay!
is it intentionally this way or this is a small bug? btw im using
flytekit==v0.26
k
@Jay Ganbat can you try the newer version of flytekit
i think this was a flytekit side bug, where we used sets instead of ordered lists
j
i havent, meaning to upgrade soon though
ohh i see
btw just out of curiosity, this conditional, is it exactly the same as using dynamic task for this, instead of conditional here, we have 1 dynamic task with native python
if else
loop
i had an issue with dynamic task retry clogging up the flytepropeller and wanted to minimize these tiny pods
k
conditional is different from dynamic
conditional is static and evaluated in the engine
j
ah gotcha; so during execution time awesome
167 Views