-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AIRFLOW-6250] handle_failure needs better default for context and test_mode #6812
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small style changes, otherwise looks good.
818a566
to
d56bf10
Compare
d56bf10
to
8e7305e
Compare
Codecov Report
@@ Coverage Diff @@
## master #6812 +/- ##
==========================================
- Coverage 84.6% 84.31% -0.29%
==========================================
Files 676 676
Lines 38331 38335 +4
==========================================
- Hits 32431 32324 -107
- Misses 5900 6011 +111
Continue to review full report at Codecov.
|
…xt (apache#6812) on_failure_callback almost always want to know the dag_id and taskinstance that failed. These info are in the context passed to on_failure_callback, which is passed in from handle_failure(). However, in some rare scenarios, if handle_failure is called in scheduler_job.py and backfill_job.py, the only argument passed is the error message. context is left as None. So in these cases, on_failure_callback will not even know what's the dag_id of the dag that just failed. This PR fixes this by setting context to get_template_context() if it's not given.
Make sure you have checked all steps below.
Jira
Description
on_failure_callback almost always want to know the dag_id and taskinstance that failed. These info are in the context passed to on_failure_callback, which is passed in from handle_failure(). However, in some rare scenarios, if handle_failure is called in scheduler_job.py and backfill_job.py, the only argument passed is the error message. context is left as None.
So in these cases, on_failure_callback will not even know what's the dag_id of the dag that just failed.
This PR fixes this by setting context to get_template_context() if it's not given.
Tests
Added test in test_taskinstance.py
Commits
Documentation