Skip to content

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
v-kay:v1-10-stable
Closed

invoke handleCallback on dag when manually deleting a DagRun from Airflow UI#9750
v-kay wants to merge 1 commit intoapache:v1-10-stablefrom
v-kay:v1-10-stable

Conversation

@v-kay
Copy link

@v-kay v-kay commented Jul 10, 2020

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.

Execute handleCallback on DagRun deletion from Airflow UI
@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get the result using a single query?

@ashb
Copy link
Member

ashb commented Jul 10, 2020

Same discusson point around #9636 applies here

@v-kay
Copy link
Author

v-kay commented Jul 10, 2020

@ashb Thanks for the quick response.

Can we expect this feature to be included in the next airflow release ?

Thanks.

@stale
Copy link

stale bot commented Oct 4, 2020

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.

@stale stale bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Oct 4, 2020
@stale stale bot closed this Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webserver Webserver related Issues stale Stale PRs per the .github/workflows/stale.yml policy file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants