-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Consistent way of checking Airflow version in providers #44686
Conversation
2dd3b8d
to
d077918
Compare
55672b3
to
de351db
Compare
Great idea, thanks Jarek ! |
de351db
to
9720404
Compare
3e3291f
to
b78485c
Compare
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.
Copilot reviewed 145 out of 160 changed files in this pull request and generated no suggestions.
Files not reviewed (15)
- contributing-docs/08_static_code_checks.rst: Language not supported
- contributing-docs/testing/unit_tests.rst: Language not supported
- dev/breeze/doc/images/output_static-checks.txt: Language not supported
- providers/src/airflow/providers/MANAGING_PROVIDERS_LIFECYCLE.rst: Language not supported
- providers/src/airflow/providers/amazon/version_compat.py: Evaluated as low risk
- providers/src/airflow/providers/common/compat/version_compat.py: Evaluated as low risk
- providers/src/airflow/providers/cncf/kubernetes/version_compat.py: Evaluated as low risk
- providers/src/airflow/providers/amazon/aws/transfers/gcs_to_s3.py: Evaluated as low risk
- .pre-commit-config.yaml: Evaluated as low risk
- providers/src/airflow/providers/amazon/aws/utils/init.py: Evaluated as low risk
- providers/src/airflow/providers/cncf/kubernetes/cli/kubernetes_command.py: Evaluated as low risk
- providers/src/airflow/providers/common/io/xcom/backend.py: Evaluated as low risk
- providers/src/airflow/providers/amazon/aws/hooks/redshift_sql.py: Evaluated as low risk
- providers/src/airflow/providers/common/compat/lineage/hook.py: Evaluated as low risk
- providers/src/airflow/providers/common/compat/assets/init.py: Evaluated as low risk
Comments skipped due to low confidence (1)
providers/src/airflow/providers/amazon/aws/auth_manager/aws_auth_manager.py:42
- The variable name AIRFLOW_V_2_9_PLUS is clear and consistent with the naming convention used in the PR.
from airflow.providers.amazon.version_compat import AIRFLOW_V_2_9_PLUS
Thanks very much for making these changes Jarek |
3bd4327
to
22b6bb2
Compare
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.
Nice, thanks jarek for the updates and it looks like ruff analyze graph
playing nice role.
Great suggestion Ash :)
This is extracted out of apache#44686 - pre-requisite for consistency check and consistency change to always use version_compat embedded in providers and avoid mistakes with importing the compat from tests in the providers code. This is purely extraction of constants that use to be in compat module to version_compat - which will make it easy to write the pre-commit to check if version_compat from tests_modules is used accidentally.
I think this one should be green. I also extracted out the pure refactor of test version constants to "version_compat" module - that will make this one much smaller (and makes it way easier to see if version_compat is used properly in the |
22b6bb2
to
ce0297a
Compare
This is extracted out of apache#44686 - pre-requisite for consistency check and consistency change to always use version_compat embedded in providers and avoid mistakes with importing the compat from tests in the providers code. This is purely extraction of constants that use to be in compat module to version_compat - which will make it easy to write the pre-commit to check if version_compat from tests_modules is used accidentally.
ce0297a
to
3e006ab
Compare
This is extracted out of apache#44686 - pre-requisite for consistency check and consistency change to always use version_compat embedded in providers and avoid mistakes with importing the compat from tests in the providers code. This is purely extraction of constants that use to be in compat module to version_compat - which will make it easy to write the pre-commit to check if version_compat from tests_modules is used accidentally.
3e006ab
to
4572c77
Compare
…4774) This is extracted out of #44686 - pre-requisite for consistency check and consistency change to always use version_compat embedded in providers and avoid mistakes with importing the compat from tests in the providers code. This is purely extraction of constants that use to be in compat module to version_compat - which will make it easy to write the pre-commit to check if version_compat from tests_modules is used accidentally.
This PR introduces consistent way of checking version of Airflow by Airflow providers. So far there were about 6 different ways on how Providers checked for Airflow version - this PR aims to unify this approach for now and in the future - at least until minimum version of Airflow set to 2.11 where we are likely to introduce a simpler check via apache#44607. Until then all providers are going to have `version_references.py` module copied in their sources that they will be importing the constants from. This PR also adds pre-commit that checks if the ``version_compat.py`` module is imported from local package copy or maybe from another provider or test code - both causing unneeded dependencies from the provider - to another package or to test code respectively.
4572c77
to
f0d76a5
Compare
Rebased after merging #44774 - this should be now much easier to review :) |
Merging it |
…ache#44774) This is extracted out of apache#44686 - pre-requisite for consistency check and consistency change to always use version_compat embedded in providers and avoid mistakes with importing the compat from tests in the providers code. This is purely extraction of constants that use to be in compat module to version_compat - which will make it easy to write the pre-commit to check if version_compat from tests_modules is used accidentally.
This PR introduces consistent way of checking version of Airflow by Airflow providers. So far there were about 6 different ways on how Providers checked for Airflow version - this PR aims to unify this approach for now and in the future - at least until minimum version of Airflow set to 2.11 where we are likely to introduce a simpler check via apache#44607. Until then all providers are going to have `version_references.py` module copied in their sources that they will be importing the constants from. This PR also adds pre-commit that checks if the ``version_compat.py`` module is imported from local package copy or maybe from another provider or test code - both causing unneeded dependencies from the provider - to another package or to test code respectively.
This PR introduces consistent way of checking version of Airflow
by Airflow providers. So far there were about 6 different ways on
how Providers checked for Airflow version - this PR aims to unify
this approach for now and in the future - at least until minimum
version of Airflow set to 2.11 where we are likely to introduce
a simpler check via #44607. Until then all providers are going
to have
version_references.py
module copied in their sourcesthat they will be importing the constants from.
This PR also adds pre-commit that checks if the
version_compat.py
module is imported from local package copyor maybe from another provider or test code - both causing
unneeded dependencies from the provider - to another package or
to test code respectively.
^ 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.