feat(ingestion/fabric): emit notebook column lineage from code renames

ST
1d ago
+2213-96

Summary

  • When notebook_execution.reconcile_code is on, Python notebook column renames are emitted as column-level lineage on the Spark job that writes each table.
  • Covers col(src).alias(dst), {source: target} mapping dicts, alias.*, df["column"], and select lists built before they are applied (select(*select_exprs)). Literal columns are omitted. An edge is kept only when both tables were resolved by the Spark plan and ingested in the same run.
  • Column names use the same normalization as schema fields, so a code name such as person_PersonParty matches person_personparty when convert_urns_to_lowercase is on.

Column lineage is stored on the job's dataJobInputOutput.fineGrainedLineages, not on the dataset upstreamLineage aspect.

Test plan

  • pytest metadata-ingestion/tests/unit/fabric_onelake/test_notebook_code_lineage.py metadata-ingestion/tests/unit/fabric_onelake/test_notebook_jobs.py
  • Ingest a notebook with include_notebooks: true, notebook_execution.enabled: true, and reconcile_code: true
  • On the Spark job, confirm inputOutput.fineGrainedLineages links each output field to its upstream field
  • Confirm reconcile_code: false still emits table lineage and no column edges
  • With convert_urns_to_lowercase: true, confirm field paths match the lowercased schema fields