Add prek hook to enforce conf import from compat SDK in providers#64564
Merged
potiuk merged 2 commits intoapache:mainfrom Apr 1, 2026
Merged
Add prek hook to enforce conf import from compat SDK in providers#64564potiuk merged 2 commits intoapache:mainfrom
potiuk merged 2 commits intoapache:mainfrom
Conversation
potiuk
approved these changes
Apr 1, 2026
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
Contributor
|
Cool! |
potiuk
added a commit
to potiuk/airflow
that referenced
this pull request
Apr 1, 2026
…SDK in providers (apache#64564) (apache#64567)" This reverts commit ef3f941.
1 task
potiuk
added a commit
that referenced
this pull request
Apr 1, 2026
Subham-KRLX
pushed a commit
to Subham-KRLX/airflow
that referenced
this pull request
Apr 3, 2026
…ache#64564) * Add prek hook to enforce conf import from compat SDK in providers * Add executor file checks for allowed configuration imports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
related: #64143, #60000
Why
Providers have historically imported
conffromairflow.configurationorairflow.sdk.configurationdirectly, which breaks cross-version compatibility between Airflow 2 and 3. We need to enforce thatconfis onlyimported from
airflow.providers.common.compat.sdk.What
check_conf_import_in_providers.pyprek hook that uses AST-based import analysis to detect forbiddenconfimports fromairflow.configurationandairflow.sdk.configurationin provider source files.providers/.pre-commit-config.yamltargeting^.*/src/airflow/providers/.*\.py$.Was generative AI tooling used to co-author this PR?