You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hkc-8010 (via GitHub)" <gi...@apache.org> on 2026/05/02 20:14:56 UTC
Re: [PR] Lazy-load Alembic in db_manager imports [airflow]
hkc-8010 commented on PR #65655:
URL: https://github.com/apache/airflow/pull/65655#issuecomment-4364634671
Follow-up after investigating the draft conversion / CI failures:
- The `core` failures in `Pendulum2`, `LowestDeps`, and the regular DB matrices were all the same two failures in `airflow-core/tests/unit/utils/test_db_manager.py`. The root cause was the new regression test mutating `sys.modules` in-process and only partially restoring state.
- The `providers` failure (`providers/edge3/tests/unit/edge3/models/test_db.py::TestEdgeDBManager::test_create_db_from_orm`) was a separate compatibility issue: existing tests patch `airflow.utils.db_manager.command`, and my first lazy-import version removed that module attribute.
This follow-up push addresses both:
- replaces the `sys.modules` mutation with a subprocess-based import assertion, so the regression test is hermetic
- keeps `airflow.utils.db_manager.command` available through a lazy proxy, so patch-based tests keep working without reintroducing eager Alembic imports
Local validation on Python `3.10` in Breeze:
- `python -m pytest airflow-core/tests/unit/utils/test_db_manager.py -q`
- `python -m pytest providers/edge3/tests/unit/edge3/models/test_db.py -q`
- import smoke check for `airflow.utils.db_manager` and `airflow.utils.db` stays clean (no Alembic plugin noise)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org