ephraimbuddy opened a new pull request, #55139:
URL: https://github.com/apache/airflow/pull/55139
DagBag is not a DB model, it’s the parser/collector used by the dag
processor. This change moves it to a more natural home under
airflow/dag_processing, reduces confusion between “DBDagBag” and "DagBag",
and helps avoid import tangles.
**What changed:**
New module: airflow.dag_processing.dagbag now hosts: DagBag,
_capture_with_reraise, FileLoadStat, timeout, sync_bag_to_db
Old location airflow.models.dagbag:
Trimmed to DB-facing helpers (DBDagBag, etc.)
Adds __getattr__ shim for backward compatibility.
Updated imports across the codebase
Pre-commit path allowlist updated to include the new file and remove the old
path.
**Deprecation & migration**
Deprecated: from airflow.models.dagbag import DagBag
Use instead: from airflow.dag_processing.dagbag import DagBag
A deprecation warning is emitted via the shim; no functional behavior change
intended.
**Notes**
No runtime logic changes to parsing or DAG discovery.
Tests and CLI code updated to the new import path.
sync_bag_to_db moved alongside DagBag to keep parsing + persistence in one
place.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]