Hugo Polloli
09/14/2021, 7:35 AM@task(state_handlers=[my_handler])
def my_task(my_input):
self.message = f"Input {my_input} wasn't ok"
assert input_is_ok(my_input)
self.message = f"Failed to do_some_things for {my_input}"
res = do_some_things(my_input)
self.message = f"Failed to do_a_few_more for {my_input}"
res2 = do_a_few_more(res)
return res2
I understand I could use signals, using the value property of a signal to store what I want to print, but that would mean wrapping each row I'm performing an action in inside a try/except block, then raising the signal inside the except block, I've done that and it gets really cluttered
I maybe missed something obvious and am going in the wrong direction though...Kevin Kho
prefect.context.x = 3
and then it will be available in the state handler, but probably not for downstream tasks because it’s not mutable.Hugo Polloli
09/14/2021, 1:57 PM