You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/25 15:23:21 UTC

[GitHub] [airflow] mobuchowski commented on a diff in pull request #27113: notification: add dag run state notification system

mobuchowski commented on code in PR #27113:
URL: https://github.com/apache/airflow/pull/27113#discussion_r1004635203


##########
airflow/models/dagrun.py:
##########
@@ -580,11 +591,11 @@ def recalculate(self) -> _UnfinishedStates:
             self.set_state(DagRunState.FAILED)
             if execute_callbacks:
                 dag.handle_callback(self, success=False, reason='task_failure', session=session)
-            elif dag.has_on_failure_callback:
+            elif dag.has_on_failure_callback or notification:
                 from airflow.models.dag import DagModel
 
                 dag_model = DagModel.get_dagmodel(dag.dag_id, session)
-                callback = DagCallbackRequest(
+                cb = DagCallbackRequest(

Review Comment:
   Changed that, also the notification now does not rely on `DagCallbackRequest` - since we don't always have it, like in `BackfillJob`.



##########
airflow/models/dagrun.py:
##########
@@ -593,17 +604,22 @@ def recalculate(self) -> _UnfinishedStates:
                     msg='task_failure',
                 )
 
+                if notification:
+                    notification(dag_run=self, callback_request=cb)
+                if dag.has_on_success_callback:

Review Comment:
   Changed that, also the notification now does not rely on DagCallbackRequest - since we don't always have it, like in BackfillJob.
   



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org