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 2020/07/10 07:24:24 UTC

[GitHub] [airflow] v-kay opened a new pull request #9750: invoke handleCallback on dag when manually deleting a DagRun from Airflow UI

v-kay opened a new pull request #9750:
URL: https://github.com/apache/airflow/pull/9750


   Airflow UI, provides functionality to delete a DagRun from the list of dag runs of all the days.
   
   Currently while deleting a DagRun, the on_success_callback and on_failure_callback functions are not used or can say there should be another on_delete_callback function to handle this type of action.
   
   Adding the handle_callback on deleting a DagRun would be beneficial in sending alerts on DagRun deletion.
   
   I have made some changes to leverage on_failure_callback for the delete action.


----------------------------------------------------------------
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.

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



[GitHub] [airflow] stale[bot] closed pull request #9750: invoke handleCallback on dag when manually deleting a DagRun from Airflow UI

Posted by GitBox <gi...@apache.org>.
stale[bot] closed pull request #9750:
URL: https://github.com/apache/airflow/pull/9750


   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] turbaszek commented on a change in pull request #9750: invoke handleCallback on dag when manually deleting a DagRun from Airflow UI

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #9750:
URL: https://github.com/apache/airflow/pull/9750#discussion_r452689426



##########
File path: airflow/www_rbac/views.py
##########
@@ -2528,12 +2528,22 @@ class DagRunModelView(AirflowModelView):
         'run_id': wwwutils.dag_run_link,
     }
 
+    @staticmethod
+    def notify(items, session):
+        for item in items:
+            dag_run = session.query(DagRun).filter(
+                DagRun.dag_id == item.dag_id,
+                DagRun.execution_date == item.execution_date
+            ).one()
+            dagbag.get_dag(item.dag_id).handle_callback(dag_run, success=False, reason='deleted', session=session)

Review comment:
       Can we get the result using a single query? 




----------------------------------------------------------------
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.

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



[GitHub] [airflow] ashb commented on pull request #9750: invoke handleCallback on dag when manually deleting a DagRun from Airflow UI

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #9750:
URL: https://github.com/apache/airflow/pull/9750#issuecomment-656553652


   Same discusson point around https://github.com/apache/airflow/pull/9636 applies here


----------------------------------------------------------------
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.

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



[GitHub] [airflow] stale[bot] commented on pull request #9750: invoke handleCallback on dag when manually deleting a DagRun from Airflow UI

Posted by GitBox <gi...@apache.org>.
stale[bot] commented on pull request #9750:
URL: https://github.com/apache/airflow/pull/9750#issuecomment-703189605


   This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] v-kay commented on pull request #9750: invoke handleCallback on dag when manually deleting a DagRun from Airflow UI

Posted by GitBox <gi...@apache.org>.
v-kay commented on pull request #9750:
URL: https://github.com/apache/airflow/pull/9750#issuecomment-656596765


   @ashb Thanks for the quick response.
   
   Can we expect this feature to be included in the next airflow release ?
   
   Thanks.


----------------------------------------------------------------
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.

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