philip
06/01/2020, 9:09 AMException raised while calling state handlers: KeyError(<Parameter: fisrt_num>,)
how can i solve this problem?
Here is my code
@task
def add(x, y):
return x+y
def post_to_slack(task, old_state, new_state):
if new_state.is_failed():
msg = "Task {0} finished in state {1}".format(task, new_state)
if new_state.is_finished():
p = new_state.result[num].result
print(p)
return new_state
with Flow("Tutorial", state_handlers=[post_to_slack]) as flow:
x = Parameter("fisrt_num")
y = Parameter("Second_num")
num = add(x,y)
Chris White
06/01/2020, 2:52 PMx
within your State Handler; this relies on the statehandler being run in the same process that you created x
and could lead to unexpected errorsphilip
06/01/2020, 3:50 PMnum
in handler?