uranusjr commented on code in PR #48002:
URL: https://github.com/apache/airflow/pull/48002#discussion_r2010348201
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -792,6 +793,25 @@ def _handle_trigger_dag_run(
return _handle_current_task_success(context, ti)
+def _run_task_state_change_callbacks(
+ task: BaseOperator,
+ kind: Literal[
+ "on_execute_callback",
+ "on_failure_callback",
+ "on_success_callback",
+ "on_retry_callback",
+ "on_skipped_callback",
+ ],
+ context: Context,
+ log: Logger,
+) -> None:
+ for i, callback in enumerate(getattr(task, kind)):
+ try:
+ callback(context)
+ except Exception:
+ log.exception("Failed to run task callback", kind=kind, index=i,
callback=callback)
Review Comment:
In the 2.x implementation they do not fail the test. (But `pre_execute` and
`post_execute` do so I don’t even know.)
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -792,6 +793,25 @@ def _handle_trigger_dag_run(
return _handle_current_task_success(context, ti)
+def _run_task_state_change_callbacks(
+ task: BaseOperator,
+ kind: Literal[
+ "on_execute_callback",
+ "on_failure_callback",
+ "on_success_callback",
+ "on_retry_callback",
+ "on_skipped_callback",
+ ],
+ context: Context,
+ log: Logger,
+) -> None:
+ for i, callback in enumerate(getattr(task, kind)):
+ try:
+ callback(context)
+ except Exception:
+ log.exception("Failed to run task callback", kind=kind, index=i,
callback=callback)
Review Comment:
In the 2.x implementation they do not fail the task. (But `pre_execute` and
`post_execute` do so I don’t even know.)
--
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]