-
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-4858] Deprecate "Historical convenience functions" in conf #5495
Conversation
In conf we want to deprecate "historical convenience functions" get, getint, getboolean, etc. However the current code doesn't issue a deprecation warning if any of these function is called. The first argument of zope.deprecation.deprecated should be string or string list to deprecate top level functions in a module. |
Codecov Report
@@ Coverage Diff @@
## master #5495 +/- ##
==========================================
+ Coverage 79.12% 79.12% +<.01%
==========================================
Files 489 489
Lines 30688 30688
==========================================
+ Hits 24281 24282 +1
+ Misses 6407 6406 -1
Continue to review full report at Codecov.
|
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.
Can you please also fix up the existing uses in side airflow that this now correctly warns about?
For example a non-exhaustive list:
- airflow/config_templates/airflow_local_settings.py contains many
- airflow/lineage/init.py
- airflow/logging_config.py
|
Sure, working on it. |
@ashb The old config methods are removed. Please review my last commit. |
airflow/configuration.py
Outdated
@@ -38,7 +38,7 @@ | |||
|
|||
# show Airflow's deprecation warnings | |||
warnings.filterwarnings( | |||
action='default', category=DeprecationWarning, module='airflow') | |||
action='always', category=DeprecationWarning, module='airflow') |
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.
Why this change? And what effect does this change have?
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.
This was for testing and accidentally added to the commit. I have changed it back. Sorry for the confusion.
The change was a little bit bigger than needed ( One small comment (on the warnings filter) then this looks good to me, thanks. (Sorry, it's conflicted again, I didn't see the ping because my inbox is currently 1k deep in unread airflow messages 😉 ) |
@ashb The conflicts have been resolved. The warnings filter was a mistake that has been corrected. Please kindly review again. Thanks. |
1. Issue old conf method deprecation warnings properly and remove current old conf method usages. 2. Unify the way to use conf as from airflow.configuration import conf 3. Fix improper test mock in tests/jobs/test_scheduler_job.py tests/test_logging_config.py If we remove the old conf method, they will mock the conf method and call the same method inside the mock object which will incur maximum recursion error.
…w.configuration These places were missed in the original PR (apache#5495)
…w.configuration (apache#5495) 1. Issue old conf method deprecation warnings properly and remove current old conf method usages. 2. Unify the way to use conf as `from airflow.configuration import conf` (cherry picked from commit f497d1d)
…w.configuration (apache#6144) These places were missed in the original PR (apache#5495) (cherry picked from commit b2e06d0)
Make sure you have checked all steps below.
Jira
Description
The first argument of zope.deprecation.deprecated should be string or string list to deprecate top level function in a module.
Tests
Commits
Documentation
Code Quality
flake8