-
Hi - I am trying to write a flow with interchangeable parameters. The flow executes \with no error thrown. But:
Is this an anti pattern or bug? Code
Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
cicdw
Jun 28, 2020
Replies: 1 comment
-
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 # 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
) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gryBox
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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,
overrides your original
name = Parameter("name", default=None)
task with a newGetItem
task. You should instead do something like (untested code):