https://prefect.io logo
d

Dan DiPasquo

06/08/2020, 10:24 PM
Working on upgrade to 0.11.... from a _state_handler_ invocation, we need to access the return value of write() method on a custom ResultHandler (now wrapped inside a ResultHandlerResult instance as I understand it). The state handler receives a _new_state_ instance, but as I read it there's a getter on State.result that gives back a scalar value rather than the result instance from which I might access location attribute where result_handler.write() retval appears to be stored. What is the right way to access this?
c

Chris White

06/08/2020, 10:25 PM
Hi Dan - you can find the full result instance at state._result
(Note the underscore)
d

Dan DiPasquo

06/08/2020, 10:29 PM
Thanks Chris. We were doing
new_state._result.safe_value.value
previously, but that seemed to break with 0.11. I will revisit that.
c

Chris White

06/08/2020, 10:30 PM
Ah gotcha so the new “safe value” is now state._result.location
d

Dan DiPasquo

06/08/2020, 10:33 PM
Awesome, was just going to try that - thank you!
🎯
c

Chris White

06/08/2020, 10:42 PM
💯
2 Views