dherincx
05/11/2020, 8:05 PMifelse
control flow to determine which task gets applied over a mapped task. Below, I've attached a simple example. When I run the flow, I don't get an error, but rather, each iteration of the mapped task enters the true
condition despite there being cases where the condition is clearly false. Can someone point me in the right direction? Am I using the ifelse
correctly?
param = [[], 2, 3, [], 4]
@task
def cond(val):
if isinstance(val, int):
return True
else:
return False
@task
def print_true(val):
print(f"Value is {val}")
@task
def print_false(val):
print("This is a list...")
with Flow('Insert Health System Data') as flow:
flag = cond.map(param)
true_task = print_true.map(param)
false_task = print_false.map(param)
ifelse(flag, true_task, false_task)
flow.run()
Kyle Moon-Wright
05/11/2020, 8:31 PMifelse
, which you can read here .dherincx
05/11/2020, 8:44 PMifelse
over a task being mapped and I'm unsure how the false
logic is never entered, even in my simple exampleKyle Moon-Wright
05/11/2020, 9:39 PMdherincx
05/11/2020, 9:40 PMKyle Moon-Wright
05/11/2020, 9:42 PMdherincx
05/11/2020, 9:43 PMcase
already!Jeremiah
05/11/2020, 11:16 PMdherincx
05/11/2020, 11:17 PM