Skip to content
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

Deprecate PY* constants into the airflow module #37575

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

Taragolis
Copy link
Contributor

@Taragolis Taragolis commented Feb 20, 2024

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.

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

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

Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

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

LGTM

airflow/__init__.py Show resolved Hide resolved
@Taragolis Taragolis removed the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Feb 21, 2024
@Taragolis Taragolis force-pushed the deprecate-py-constants branch from 1494c47 to 584347d Compare February 21, 2024 16:08
@potiuk potiuk merged commit 564adcf into apache:main Feb 21, 2024
59 checks passed
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Mar 6, 2024
@ephraimbuddy ephraimbuddy 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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core-operators Operators, Sensors and hooks within Core Airflow area:providers area:serialization provider:apache-hive type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants