Skip to content

Backport #32378 to 1.13: cap pygtrie below 2.6 so import airflow works on Python 3.10 - #32431

Merged
Khairajani merged 1 commit into
1.13from
backport/pygtrie-2.6-py310-import-1.13
Sep 2, 2026
Merged

Khairajani merged 1 commit into
1.13from
backport/pygtrie-2.6-py310-import-1.13

Conversation

@Khairajani

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #32378 to 1.13. Original issue: #32377.

pygtrie 2.6.0 (published 2026-09-01T11:06Z) annotates with typing.Self (PEP 673, Python 3.11+) but declares no requires-python floor, so pip and uv install it on 3.10, where it is unimportable:

$ python3.10 -c "import pygtrie"
AttributeError: module 'typing' has no attribute 'Self'   # pygtrie.py:83, `def __copy__(self) -> _t.Self`

apache-airflow-core and apache-airflow-task-sdk both require pygtrie>=2.5.0 with no ceiling, and airflow._shared.logging.structlog imports it at module level — reached from airflow/__init__.py via configuration.initialize_secrets_backends(). The AttributeError therefore surfaces as:

ImportError: cannot import name 'Connection' from 'airflow.models'

which on main took out python / Unit Tests & Static Checks (3.10) and python / Integration Tests (shard-3, 3.10), turning py-tests-status red and evicting every PR touching ingestion/ from the merge queue.

Why 1.13 needs it. This branch pins apache-airflow==3.3.1 (so it pulls apache-airflow-core/task-sdk and their uncapped pygtrie>=2.5.0), runs MAIN_PYTHON_VERSION: "3.10" with a ["3.10","3.11","3.12"] matrix, and does not carry the cap. pygtrie 2.6.0 is now PyPI's latest, so any fresh resolution here selects it. The breakage is currently latent only because recent runs on this base have had their Python jobs path-filtered to skipped; the first PR that touches ingestion/ and actually runs the suite will be blocked.

Cherry-picked clean, no conflicts — identical three-line change (cap in VERSIONS, applied to the airflow plugin extra and to the test extra, which is where CI actually pulls Airflow in).

Type of change:

  • Bug fix

High-level design:

N/A — dependency cap backport.

Tests:

Use cases covered

  • ingestion[test] resolves on Python 3.10 with an importable pygtrie
  • import airflow works, so the Airflow connector unit tests and integration shard-3 collect

Unit tests

  • Not applicable — dependency constraint; verification is the resolver and CI itself.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion code changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Full resolver dry-run of the affected extra against this branch on Python 3.10 — no conflict:

$ python3.10 -m pip install --dry-run --ignore-installed "./ingestion[test]"
  pygtrie: 2.5.0
  apache-airflow: 3.3.1
  apache-airflow-core: 3.3.1

ruff check and ruff format --check clean. This PR's own py-tests run on 3.10 is the real regression test.

UI screen recording / screenshots:

Not applicable.

Checklist:

…thon 3.10 (#32378)

pygtrie 2.6.0 (released 2026-09-01T11:06Z) annotates with typing.Self, which
only exists on 3.11+, yet publishes no requires-python floor -- so pip and uv
happily install it on 3.10, where `import pygtrie` raises

    AttributeError: module 'typing' has no attribute 'Self'

apache-airflow-core and apache-airflow-task-sdk both require pygtrie>=2.5.0
with no ceiling, and airflow._shared.logging.structlog imports it at module
level. That module is reached from airflow/__init__.py through
configuration.initialize_secrets_backends(), so the AttributeError surfaces as

    ImportError: cannot import name 'Connection' from 'airflow.models'

which took out every py-tests run that resolved dependencies after 11:06Z on
the 3.10 lane -- unit tests and integration shard-3 alike. 3.11 and 3.12 were
unaffected because they have typing.Self.

Cap it in VERSIONS and apply it both to the airflow plugin extra and to the
test extra, which is where CI actually pulls Airflow in. Drop the cap once
pygtrie declares its floor or 3.10 support is dropped.

(cherry picked from commit 0fab248)
@Khairajani
Khairajani requested a review from a team as a code owner September 2, 2026 06:17
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backports the pygtrie version cap to fix import airflow on Python 3.10 by pinning pygtrie<2.6, preventing the AttributeError from pygtrie 2.6.0's use of typing.Self (Python 3.11+). No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

@Khairajani
Khairajani enabled auto-merge (squash) September 2, 2026 16:45
@Khairajani
Khairajani merged commit 115d572 into 1.13 Sep 2, 2026
205 of 223 checks passed
@Khairajani
Khairajani deleted the backport/pygtrie-2.6-py310-import-1.13 branch September 2, 2026 16:46

This branch was previously deployed

1 inactive deployment
test — a7bbf071 Deployed Sep 2, 2026 by Khairajani via playwright-ci-postgresql (5, 6) #77829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants