Open GalLadislav opened 6 days ago
Flow returning None with failed task ends with state Completed instead of Failed. This issue happens for documented example code for Return None.
This behavior occurs for tasks too.
import prefect @prefect.task() def task1(): raise ValueError("Task 1 failed") @prefect.task() def task2(): task1.submit().result(raise_on_failure=False) @prefect.flow() def flow_failed_submit(): task1.submit().result(raise_on_failure=False) task2.submit().result(raise_on_failure=False) @prefect.flow() def flow_failed_state(): task1(return_state=True) task2(return_state=True) if __name__ == "__main__": flow_failed_submit(return_state=True) flow_failed_state(return_state=True)
No response
prefect version
Version: 3.0.0rc9 API version: 0.8.4 Python version: 3.12.4 Git commit: b75631a7 Built: Mon, Jun 24, 2024 5:50 PM OS/Arch: linux/x86_64 Profile: default Server type: ephemeral Pydantic version: 2.8.0 Server: Database: sqlite SQLite version: 3.37.2
prefect.flow_engine.FlowRunEngine.handle_success() should probably in case of returned None value pass to prefect.states.return_value_to_state() list of task run results from RunContext?
Thanks for the issue @GalLadislav - we'll look into this one.
First check
Bug summary
Flow returning None with failed task ends with state Completed instead of Failed. This issue happens for documented example code for Return None.
This behavior occurs for tasks too.
Reproduction
Error
No response
Versions (
prefect version
output)Additional context
prefect.flow_engine.FlowRunEngine.handle_success() should probably in case of returned None value pass to prefect.states.return_value_to_state() list of task run results from RunContext?