https://flyte.org logo
#flytekit
Title
# flytekit
j

Jay Ganbat

02/23/2022, 10:41 PM
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

Ketan (kumare3)

02/23/2022, 11:01 PM
@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

Jay Ganbat

02/23/2022, 11:01 PM
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

Ketan (kumare3)

02/24/2022, 12:52 AM
conditional is different from dynamic
conditional is static and evaluated in the engine
j

Jay Ganbat

02/24/2022, 4:19 AM
ah gotcha; so during execution time awesome
81 Views