Skip to content

Flow with interchangeable Parameters #2881

Answered by cicdw
gryBox asked this question in General
Discussion options

You must be logged in to vote

Hi @gryBox - remember that building a Flow represents building a deferred computational graph. So as much as it looks and feels like "normal" python code, every line is run. In particular,

    # Handle missing name
    with case(name.is_equal(None), True):
        name = id_dict["name"]

overrides your original name = Parameter("name", default=None) task with a new GetItem task. You should instead do something like (untested code):

    # Handle missing name
    with case(name.is_equal(None), True):
        greeting1 = get_greeting(
        id_dict["name"],
        id_dict
    )
   with case(name.is_equal(None), False):
        greeting2 = get_greeting(
        name,
        id_dict
    )

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gryBox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants