Skip to content

Split airflow loader into a focused package - #54

Merged
ghanse merged 1 commit into
mainfrom
refactor/split-airflow-loader
Sep 11, 2026
Merged

Split airflow loader into a focused package#54
ghanse merged 1 commit into
mainfrom
refactor/split-airflow-loader

Conversation

@peterpark-db

Copy link
Copy Markdown
Contributor

Splits the ~4,300-line src/flowx/sources/airflow/loader.py into a focused loader/ package along its existing seams, as pure moves with no behavior change. Addresses databricks-field-eng/flowx#36.

Package modules: captures, ast_utils, schedule, dispatch, graph, visitor, dag_discovery, policy, activity_templates, taskflow, dbt, reconcile, lowering, api, plus a thin __init__ facade re-exporting the five public entry points (load_airflow_dag, load_airflow_dags, load_pipelines, discover_dags, detect_hosts). Public imports are unchanged; single-owner constants (e.g. the _UNRESOLVED identity sentinel) are imported rather than copied; _DagVisitor, _load_airflow_module, and _reconcile_pipeline move intact, leaving their internal decomposition as separate follow-ups.

Verification (pure move / no behavior change)

  • Pipeline IR byte-identical to the base commit for representative DAGs (golden_pipeline_dag, orders_analytics_dag).
  • AST-normalized comparison of every function/method body: identical except one required namespace qualifier (reconcile._reconcile_pipeline(...)) that preserves the reconciliation tests' monkeypatch.
  • 1218 unit + 141 integration tests pass; mypy and ruff clean.

Move sources/airflow/loader.py (~4,300 lines) into a loader/ package along its existing seams (captures, ast_utils, schedule, dispatch, graph, visitor, dag_discovery, policy, activity_templates, taskflow, dbt, reconcile, lowering, api). Pure moves: public entry points unchanged via a thin facade, single-owner constants imported rather than copied. Addresses databricks-field-eng/flowx#36.
@peterpark-db
peterpark-db requested a review from ghanse September 9, 2026 19:12
@peterpark-db peterpark-db self-assigned this Sep 9, 2026
@peterpark-db peterpark-db added the enhancement New feature or request label Sep 9, 2026

@ghanse ghanse left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added #67 to track future decomposition of _DagVisitor

@ghanse
ghanse merged commit b8d0766 into main Sep 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved for merge enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants