Hui Zheng
03/02/2021, 11:50 PM====== final results: <Success: "All reference tasks succeeded.">
or
====== final results: <Failed: "Some reference tasks failed.">
We have different types of successes/failures. Currently we could not differentiate them from the flow hook notification message. We would like to set customized messages to different scenarios and react differently.
for example
====== final results: <Failed: "Task_A failed due to timeout.">
Zanie
import prefect
from prefect.engine.state import Success
from prefect import Flow, task
def update_final_state(flow, old_state, new_state):
if isinstance(new_state, Success):
new_state.message = "Hello world!"
print(f"At state: {new_state}")
return new_state
@task
def do_nothing():
pass
with Flow("example-flow-final-state", state_handlers=[update_final_state]) as flow:
do_nothing()
flow.run()
but the final state of the flow may be a special case so I'm not sure it'll be reflected in the UIZanie
Zanie
Hui Zheng
03/03/2021, 2:00 AMHui Zheng
03/03/2021, 2:02 AMZanie
Zanie
Hui Zheng
03/03/2021, 5:22 AMHui Zheng
03/03/2021, 5:23 AMZanie
Jeremiah
Hui Zheng
03/03/2021, 7:36 PM