Repository navigation
Airflow: map discovery captures to shared source graphs - #108
peterpark-db wants to merge 3 commits into
Conversation
Code reviewFound 11 issues:
flowx/src/flowx/sources/airflow/loader/graph.py Lines 19 to 39 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 262 to 276 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 347 to 359 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 232 to 255 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 544 to 589 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 129 to 141 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 251 to 258 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 440 to 461 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 408 to 413 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 67 to 103 in 4290cf9
flowx/src/flowx/sources/airflow/discovery_mapping.py Lines 222 to 250 in 4290cf9 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
matthewmoorcroft
left a comment
There was a problem hiding this comment.
Thanks Peter. #108 fits the ADF side well, and I've aligned my phase 1 stack to it. I plan to land #84 to #97 first, so you can rebase this onto main afterwards whenever suits you. Two things touch this PR because of changes on my side:
-
discovery_inventory.py: #84 now carries a single shared version of this module. It keeps your function signature, the inventory_visible filter and your test cases as written, reads motifs from graph lineage, and adds task_key (the same value you stitch in). Because we both add this file and its test, your rebase onto main will hit an add/add conflict on those two files. Taking the #84 copy should be all it needs; nothing else in this PR should have to change.
-
source_graphs.json (optional): #84 adds a helper that writes exactly your envelope (contract_version, source, graphs) plus a content hash per graph and for the document. ADF writes the same file through it, and your file stays valid as it is. If you want Airflow to carry the hashes too, switching to the helper does it. The same applies to source_insights.json (agent enrichment) and the typed ConversionPlan if Airflow ever needs them. Your call.
Separately, a few things I noticed while testing, in case they're useful:
- Merge conflict: this conflicts with #120 in src/flowx/sources/airflow/loader/lowering.py, so whichever lands second will need to resolve it.
- Coverage count: gap nodes come out of
_gap_nodeswithstrategy: "unsupported"(discovery_mapping.py:679). Since the inventory activities are now graph-driven, coverage.py counts them in unsupported_activities while the summary still says unsupported_count: 0 (discover.py:138), so a DAG with an unclaimed statement goes from 0 to 1 unsupported in the coverage row written to the results table. - Templated trigger targets:
trigger_dag_id="{{ params.t }}"produces a control edge marked resolved to a workflow literally named{{ params.t }}(discovery_mapping.py:428); treating Jinja-templated targets as unresolved, like the Variable.get case, would avoid that. - Inventory description: the per-activity list changes for fan, pe, eb and dsem (the summary is identical), which may be worth noting in the PR description.
Happy to talk any of it through.
…he saved graphs, insights and plan Wording only. The migrate workflow and route skill still said enrich merges into inventory.json, and the migrate skill still said Airflow routing aligns via #63; they now describe source_insights.json and that route refuses agentic decisions for Airflow inventories. AGENTS.md lists source_graphs.json in discover's outputs, adds rows for discovery_serde, discovery_inventory and discovery_insights, and describes the typed ConversionPlan and the ADF-only route. The README and docs output trees gain source_insights.json and conversion_plan.json, placed away from the lines #108 changes. Co-authored-by: Isaac <no-reply@databricks.com>
Summary
Closes #63.
Maps Airflow's existing static capture model onto the shared
SourceGraphcontract introduced by #84 without replacing the Airflow parser or changing the current convert/package path._DagVisitorand source audit pass for discovery graph projection and existing IR lowering;GapNodevalues;TriggerDagRunOperator, and Databricks run-now operators without treatingExternalTaskSensoras an invocation;metadata/source_graphs.jsonthrough the shared discovery serde;This PR is intentionally stacked on #84 (
discovery/shared-ast-standard). Issue #86 remains a separate Phase 2 PR that will consume the persisted source graph during conversion.Verification
make fmtmake test: 1,231 passed, 2 skippedmake integration: 141 passed, 16 deselected, 6 expected xfails