Lee-W commented on code in PR #48002:
URL: https://github.com/apache/airflow/pull/48002#discussion_r2009536369
##########
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)
Review Comment:
Not sure whether we need to check `kind` is valid. As this is an internal
thing, it's probably ok to keep it as it is?
--
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]