Repository navigation
Backport #32378 to 2.0: cap pygtrie below 2.6 so import airflow works on Python 3.10 - #32432
Conversation
…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)
❌ 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! |
✅ Playwright Results — workflow succeededValidated commit ✅ 110 passed · ❌ 0 failed · 🟡 0 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) 54m 53s ⏱️ Max setup 3m 49s · max shard execution 12m 7s · max shard-job elapsed before upload 18m 16s · reporting 3s 🌐 209.15 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
…sses 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.
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 |
|



Describe your changes:
Backport of #32378 to
2.0. Original issue: #32377.pygtrie 2.6.0(published 2026-09-01T11:06Z) annotates withtyping.Self(PEP 673, Python 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(). TheAttributeErrortherefore surfaces as:which on
maintook outpython / Unit Tests & Static Checks (3.10)andpython / Integration Tests (shard-3, 3.10), turningpy-tests-statusred and evicting every PR touchingingestion/from the merge queue.Why
2.0needs it. This branch pinsapache-airflow==3.3.1(so it pullsapache-airflow-core/task-sdkand their uncappedpygtrie>=2.5.0), runsMAIN_PYTHON_VERSION: "3.10"with a["3.10","3.11","3.12"]matrix, and does not carry the cap.pygtrie 2.6.0is 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 toskipped; the first PR that touchesingestion/and actually runs the suite will be blocked.Cherry-picked clean, no conflicts — identical three-line change (cap in
VERSIONS, applied to theairflowplugin extra and to thetestextra, which is where CI actually pulls Airflow in).Type of change:
High-level design:
N/A — dependency cap backport.
Tests:
Use cases covered
ingestion[test]resolves on Python 3.10 with an importablepygtrieimport airflowworks, 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 against this branch on Python 3.10 — no conflict:
ruff checkandruff format --checkclean. This PR's ownpy-testsrun on 3.10 is the real regression test.UI screen recording / screenshots:
Not applicable.
Checklist:
import airflow(cannot import name 'Connection' from 'airflow.models') #32377) and forward-fix (Fixes #32377: cap pygtrie below 2.6 soimport airflowworks on Python 3.10 #32378) above.