Skip to content

Add pipelines preview-lineage command - #2

Open
tanishgupta-db wants to merge 4 commits into
pipelines_datasets_commandfrom
pipelines_lineage_command
Open

Add pipelines preview-lineage command#2
tanishgupta-db wants to merge 4 commits into
pipelines_datasets_commandfrom
pipelines_lineage_command

Conversation

@tanishgupta-db

@tanishgupta-db tanishgupta-db commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Changes

Adds a hidden databricks pipelines preview-lineage command that shows a table's upstream and downstream datasets within a pipeline. It reuses the same dry-run resolution and graph-fetching as preview-datasets, then walks the graph's flows to compute lineage for the requested table. Supports the same --force-dry-run / --no-dry-run / --timeout flags and text/JSON output.

Stacked on top of #1 (preview-datasets). This PR's diff shows only the lineage-specific changes.

Why

Lineage answers "what feeds this table, and what does it feed?" from the same dry-run graph that powers preview-datasets, so it shares that machinery rather than duplicating it.

Key decisions:

  • Sinks are included downstream.
  • Honest about incompleteness. Some referenced nodes aren't defined by the pipeline (e.g. external sources it only reads). These can't be resolved to a dataset, so the command reports an unresolved_refs count

Future work (not in this PR): figure out how to surface external sources; table name duplication across nodes --> can it happen and how to handle.

Tests

Unit tests for the lineage computation (upstream/downstream resolution, multi-input flows, sink handling, unresolved-ref counting deduped across directions) and rendering (text + JSON, with and without unresolved refs); a full-flow test over the fake pipeline API covering the sink-downstream path; and acceptance tests running the real CLI against the fake on both deployment engines.

@tanishgupta-db
tanishgupta-db force-pushed the pipelines_lineage_command branch from 3cb0023 to fd896c9 Compare July 9, 2026 21:37
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_datasets_command branch from 25834f6 to a2e43e6 Compare July 9, 2026 22:50
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_lineage_command branch from fd896c9 to ed56284 Compare July 9, 2026 22:52
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_datasets_command branch from a2e43e6 to 7dcddc1 Compare July 9, 2026 23:04
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_lineage_command branch from ed56284 to 59e23b7 Compare July 9, 2026 23:12
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_datasets_command branch from 7dcddc1 to eee1577 Compare July 10, 2026 20:52
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_lineage_command branch 2 times, most recently from 41c244b to 53e7de0 Compare July 10, 2026 23:59
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_datasets_command branch from d1d163a to 57f5a7c Compare July 11, 2026 00:00
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_lineage_command branch from 53e7de0 to 097998c Compare July 11, 2026 00:00
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_datasets_command branch from 57f5a7c to e3460b2 Compare July 21, 2026 22:58
@tanishgupta-db
tanishgupta-db force-pushed the pipelines_lineage_command branch from 097998c to 3d33d8a Compare July 21, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant