Skip to content

Resolve provider namespaces from the real directory tree in prek hooks - #70468

Merged
potiuk merged 1 commit into
apache:mainfrom
FrankYang0529:airflow-drop-known-second-level-paths
Aug 13, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
FrankYang0529:airflow-drop-known-second-level-paths

Conversation

@FrankYang0529

@FrankYang0529 FrankYang0529 commented Jul 26, 2026 •

Copy link
Copy Markdown
Member

Why

  • KNOWN_SECOND_LEVEL_PATHS is a hand-maintained list of namespace prefixes. A missing entry produces no signal at all.

How

  • get_provider_id_from_path() walks up to the nearest provider.yaml and returns the provider id relative to providers/: apache.hive for a nested provider, amazon for a top-level one.
  • get_provider_namespace_from_path() uses get_provider_id_from_path() to detect the namespace. The segment before the dot is the namespace. The absence of a dot means the provider has none, so the answer comes from the provider's own position in the tree rather than from a list.
  • check_providers_subpackages_all_have_init.py: folder.name in KNOWN_SECOND_LEVEL_PATHS becomes folder.name == namespace.
  • mypy_folder.py uses is_duplicated_namespace_init() to resolve each file's own provider and checks whether that file is that provider's namespace __init__.py.

Verification

  • uv run --project scripts pytest scripts/tests/

Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@FrankYang0529
FrankYang0529 force-pushed the airflow-drop-known-second-level-paths branch from fe2e600 to f6ef16e Compare August 6, 2026 01:33
@potiuk potiuk added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Aug 13, 2026
@potiuk
potiuk merged commit fd6b7db into apache:main Aug 13, 2026
69 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-3-test PR Link

@FrankYang0529
FrankYang0529 deleted the airflow-drop-known-second-level-paths branch August 14, 2026 06:18
potiuk pushed a commit that referenced this pull request Aug 17, 2026
…in prek hooks (#70468)

(cherry picked from commit fd6b7db)

Co-authored-by: PoAn Yang <[email protected]>
Signed-off-by: PoAn Yang <[email protected]>
potiuk pushed a commit that referenced this pull request Aug 17, 2026
…in prek hooks (#70468) (#71553)

(cherry picked from commit fd6b7db)

Signed-off-by: PoAn Yang <[email protected]>
Co-authored-by: PoAn Yang <[email protected]>
vatsrahul1001 pushed a commit that referenced this pull request Sep 7, 2026
…in prek hooks (#70468) (#71553)

(cherry picked from commit fd6b7db)

Signed-off-by: PoAn Yang <[email protected]>
Co-authored-by: PoAn Yang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants