ASk1 commented on code in PR #64568:
URL: https://github.com/apache/airflow/pull/64568#discussion_r3029152309
##########
task-sdk/src/airflow/sdk/execution_time/supervisor.py:
##########
@@ -1680,6 +1680,7 @@ def start( # type: ignore[override]
log = structlog.get_logger(logger_name="task")
state, msg, error = run(ti, context, log)
+ context["exception"] = error
finalize(ti, state, context, log, error)
Review Comment:
@kaxil
added test_inprocess_failure_callback_receives_exception, which runs a
failing task via InProcessTestSupervisor and asserts the failure callback
receives the expected context["exception"]
`pytest -q
task-sdk/tests/task_sdk/execution_time/test_supervisor.py::TestInProcessTestSupervisor::test_inprocess_failure_callback_receives_exception
-q`
- without fix
`FAILED
task-sdk/tests/task_sdk/execution_time/test_supervisor.py::TestInProcessTestSupervisor::test_inprocess_failure_callback_receives_exception
- AssertionError: assert False`
- with fix
`task-sdk/tests/task_sdk/execution_time/test_supervisor.py::TestInProcessTestSupervisor::test_inprocess_failure_callback_receives_exception
PASSED `
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]