Skip to content

Registry: make tomllib fallback version-aware#66666

Merged
potiuk merged 1 commit into
apache:mainfrom
shahar1:fix/registry-tomllib-version-check
May 10, 2026
Merged

Registry: make tomllib fallback version-aware#66666
potiuk merged 1 commit into
apache:mainfrom
shahar1:fix/registry-tomllib-version-check

Conversation

@shahar1
Copy link
Copy Markdown
Contributor

@shahar1 shahar1 commented May 10, 2026

Use explicit Python-version check for tomllib fallback in registry extract scripts.

Why:

  • Make fallback path deterministic by Python version instead of exception-driven import flow.
  • Keep registry scripts aligned and easier to read.

Changes:

  1. dev/registry/extract_metadata.py
  • Add sys import.
  • Switch tomllib/tomli import to version-aware if/else.
  1. dev/registry/extract_versions.py
  • Switch tomllib/tomli import to version-aware if/else.

This PR was split from #66250 to keep scope focused.


Was generative AI tooling used to co-author this PR?
  • Yes — GitHub Copilot (GPT-5.3-Codex)

Generated-by: GitHub Copilot (GPT-5.3-Codex) following the guidelines


Drafted-by: GitHub Copilot (GPT-5.3-Codex) (no human review before posting)

@potiuk potiuk merged commit 5b30aca into apache:main May 10, 2026
89 of 94 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Airflow Registry May 10, 2026
@potiuk potiuk added this to the Airflow 3.2.2 milestone May 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the tomllib vs tomli import path in the registry extraction scripts deterministic by switching from exception-driven imports to an explicit Python version check (sys.version_info >= (3, 11)), improving readability and consistency across the scripts.

Changes:

  • Update extract_metadata.py to import sys and use a version-aware tomllib/tomli import.
  • Update extract_versions.py to use the same version-aware tomllib/tomli import pattern.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
dev/registry/extract_metadata.py Adds sys and switches TOML parsing import logic to a Python-version-based conditional.
dev/registry/extract_versions.py Switches TOML parsing import logic to a Python-version-based conditional.

@github-actions
Copy link
Copy Markdown
Contributor

Backport failed to create: v3-2-test. View the failure log Run details

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-2-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 5b30aca v3-2-test

This should apply the commit to the v3-2-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

potiuk pushed a commit that referenced this pull request May 15, 2026
vatsrahul1001 added a commit that referenced this pull request May 15, 2026
(cherry picked from commit 5b30aca)

Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:registry backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants