Reports the column-level edges and table columns that were added or removed between two lineage objects — typically the same pipeline before and after an edit. This makes the CI story concrete: extract lineage on both branches and fail (or comment) when provenance changed.
Arguments
- old, new
Lineage objects from
extract_lineage()(or lists withnodesandedges), in before/after order.
Value
A dplyneage_lineage_diff list with data frame elements
added_edges, removed_edges, added_columns, and
removed_columns. Its print method summarises the changes;
zero-row elements mean no change.
See also
Other lineage accessors:
lineage_edges(),
lineage_tables(),
lineage_upstream()
Examples
old <- list(
nodes = list(
create_table_node("orders", "amount"),
create_table_node("out", "total", table_type = "target")
),
edges = list(create_column_edge("orders", "amount", "out", "total"))
)
new <- list(
nodes = list(
create_table_node("orders", c("amount", "tax")),
create_table_node("out", "total", table_type = "target")
),
edges = list(
create_column_edge("orders", "amount", "out", "total"),
create_column_edge("orders", "tax", "out", "total")
)
)
lineage_diff(old, new)
#> <dplyneage lineage diff>
#> Added edges:
#> + orders.tax -> out.total
#> Added columns:
#> + orders.tax