Skip to content

Deprecate PY* constants into the airflow module - #37575

Merged
potiuk merged 1 commit into
apache:mainfrom
Taragolis:deprecate-py-constants
Feb 21, 2024
Merged

Deprecate PY* constants into the airflow module#37575
potiuk merged 1 commit into
apache:mainfrom
Taragolis:deprecate-py-constants

Conversation

@Taragolis

@TaragolisTaragolis commented Feb 20, 2024

Copy link
Copy Markdown
Contributor

First constant was added in #7517 for validate is Airflow run on Python >= 3.7 and if not use backport support of PEP-562.

It is not widely use in Airflow Core, at that moment there is only one reference. However it might be not safe to use it in core, because it might create cyclic error in case if it imported somewhere else during first load, e.g. into the airflow.configurations or airflow.settings or their imports. In providers it is not practical to use it, you have to wait approx one year for allow to use it, and it also might be a reason for cyclic errors, e.g. if it use in secrets backends and their imports.

For avoid usage in project it disabled by TID251 - Banned API
All current usage, most in tests, replaced by sys.version_info


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@TaragolisTaragolis added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Feb 20, 2024
@Taragolis

Copy link
Copy Markdown
ContributorAuthor

I do not delete this constants for two reason:

  • Maybe some old version of provider still use it
  • Maybe some users use it, which is not practical

Comment threadtests/providers/apache/hive/hooks/test_hive.py Outdated

@hussein-awalahussein-awala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment threadairflow/__init__.py Outdated
@TaragolisTaragolis removed the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Feb 21, 2024
Comment threadtests/serialization/serializers/test_serializers.py Outdated
@Taragolis
Taragolisforce-pushed the deprecate-py-constants branch from 1494c47 to 584347dCompareFebruary 21, 2024 16:08
@potiuk
potiuk merged commit 564adcf into apache:mainFeb 21, 2024
@ephraimbuddyephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Mar 6, 2024
@ephraimbuddyephraimbuddy added this to the Airflow 2.9.0 milestone Mar 6, 2024
kaxil added a commit to astronomer/airflow that referenced this pull request Oct 31, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providersarea:serializationprovider:apache-hivetype:misc/internalChangelog: Misc changes that should appear in change log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@Taragolis@potiuk@Dev-iL@hussein-awala@dirrao@ephraimbuddy