invoke handleCallback on dag when manually deleting a DagRun from Airflow UI#9750
Closed
v-kay wants to merge 1 commit intoapache:v1-10-stablefrom
Closed
invoke handleCallback on dag when manually deleting a DagRun from Airflow UI#9750v-kay wants to merge 1 commit intoapache:v1-10-stablefrom
v-kay wants to merge 1 commit intoapache:v1-10-stablefrom
Conversation
Execute handleCallback on DagRun deletion from Airflow UI
turbaszek
reviewed
Jul 10, 2020
Comment on lines
+2533
to
+2538
| 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) |
Member
There was a problem hiding this comment.
Can we get the result using a single query?
Member
|
Same discusson point around #9636 applies here |
Author
|
@ashb Thanks for the quick response. Can we expect this feature to be included in the next airflow release ? Thanks. |
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.