Repository navigation
Fixes #32377: cap pygtrie below 2.6 so import airflow works on Python 3.10 - #32378
Conversation
…thon 3.10
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.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedCaps OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 109 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 50m 21s ⏱️ Max setup 4m 22s · max shard execution 15m 18s · max shard-job elapsed before upload 21m 14s · reporting 4s 🌐 219.77 requests/attempt · 1.80 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
🟡 1 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
…ks on Python 3.10 (#32432) * fix(ingestion): cap pygtrie below 2.6 so `import airflow` works on Python 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) * fix(lint): grandfather PLC0415 in test_get_dagbag so py-checkstyle passes on 2.0 The file was backported from main, where PLC0415 (import-outside-top-level) sits in the global ruff ignore list, so its three function-local imports carry no suppression. On this branch the rule is only waived through per-file-ignores that do not cover openmetadata-airflow-apis/, so `make py_format_check` fails on every PR against 2.0, unrelated to the change under review. The imports are deliberate -- each test patches utils.settings before importing the module under test -- so suppress rather than hoist, matching how the sibling airflow-apis tests already do it (see test_deploy.py:60) and how pyproject.toml documents grandfathering existing violations. Added with `ruff check --add-noqa`; `make py_format` cannot fix PLC0415 on its own since the rule has no autofix.
…thon 3.10 (#32378) (#32431) 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)
…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.
…thon 3.10 (open-metadata#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.



Describe your changes:
Fixes #32377
py-testshas been red on the Python 3.10 lane since 2026-09-01T11:06Z, takingpy-tests-statuswith it and evicting every PR that touchesingestion/from the merge queue:No code change caused it.
pygtrie 2.6.0was published at 11:06:08Z; it annotates withtyping.Self(PEP 673, 3.11+) but declares norequires-pythonfloor, so pip and uv install it on 3.10, where it is unimportable:apache-airflow-coreandapache-airflow-task-sdkboth requirepygtrie>=2.5.0with no ceiling, andairflow._shared.logging.structlogimports it at module level — reached fromairflow/__init__.pyviaconfiguration.initialize_secrets_backends(), which is why theAttributeErrorsurfaces as a missingConnection. 3.11 and 3.12 are unaffected because they havetyping.Self; 3.10 isMAIN_PYTHON_VERSION. Full chain and the package-diff evidence are in the issue.This caps
pygtrie<2.6inVERSIONSand applies it in two places:airflowplugin extra, alongside the existing transitive pins — covers the Airflow image;testextra, which is where CI actually pulls Airflow in (uv pip install "ingestion[all]"then"ingestion[test]";all-dev-envandallboth exclude the airflow plugin).ingestion/airflow-constraints-3.3.1.txt:583already pinspygtrie==2.5.0, but the unit-test install path does not apply that constraints file — which is exactly why it did not protect CI.The cap is temporary. It can be dropped once pygtrie declares
requires-python>=3.11(or switches totyping_extensions.Self), or Airflow caps the dependency, or 3.10 support is dropped. The comment inVERSIONSsays so.Type of change:
High-level design:
N/A — one-line dependency cap.
Tests:
Use cases covered
ingestion[test]resolves on Python 3.10 with apygtriethat is actually importableimport airflowworks again, so the Airflow connector unit tests and integration shard-3 collectUnit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Full resolver dry-run of the affected extra on Python 3.10 — 421 packages, no conflict:
Before the cap the same resolution selects
pygtrie 2.6.0, which is the failure. Also confirmed directly that 2.5.0 imports on 3.10 and 2.6.0 does not, and that 2.6.0 imports fine on 3.13.This PR's own
py-testsrun on 3.10 is the real regression test.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.