-
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-4939] Simplify Code for Default Task Retries #6233
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.
LGTM
EDIT: I'll have a look at the test failure. Revoking my approval first.
I wrote the exact piece of code earlier, but 1 test won't pass due to python's nature of not re-calculating function defaults again. https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments |
huh, you are right, @msumit - Thanks, will close this PR. We are using this type of code in many places AFAIK, we should change that too. |
Except an integer isn't mutable -- that caveat only applies to dicts and lists I thought? |
😬 Yeah (not sure what I was thinking) - Fixed the test. |
558f9f1
to
d719e1f
Compare
Codecov Report
@@ Coverage Diff @@
## master #6233 +/- ##
==========================================
+ Coverage 80.06% 80.06% +<.01%
==========================================
Files 610 610
Lines 35261 35261
==========================================
+ Hits 28231 28232 +1
+ Misses 7030 7029 -1
Continue to review full report at Codecov.
|
The reason the tests didn't pass was because:
The warnings applies to a case like this: def append_to(element, to=[]):
to.append(element)
return to When calling |
This is true with both code paths -- the airflow config file is only loaded once at process start up, so changing the config file on disk will not affect a running airflow process. |
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.
lgtm
Make sure you have checked all steps below.
Jira
Description
Tests
Commits
Documentation