Lineage
The Lineage resource (client.lineage) provides methods for querying and managing data lineage relationships, including cross-space connections and impact analysis.
Methods
get(space_slug, product_slug)
Get lineage information for a product.
| Parameter | Type | Description |
|---|---|---|
space_slug | str | Space identifier |
product_slug | str | Product slug |
Returns: LineageInfo with upstream and downstream lists
lineage = await client.lineage.get("analytics", "customer-events")
for product in lineage.upstream:
print(f" ← {product.name} (space: {product.space_slug})")
add_upstream(space_slug, product_slug, upstream_id)
Add a single upstream dependency. Saved bidirectionally.
| Parameter | Type | Description |
|---|---|---|
upstream_id | UUID | Upstream product UUID |
Returns: Product
await client.lineage.add_upstream("analytics", "customer-events", raw_events_id)
add_downstream(space_slug, product_slug, downstream_id)
Add a single downstream dependency. Saved bidirectionally.
Returns: Product
set_lineage(space_slug, product_id, *, upstream_ids=, downstream_ids=)
Replace the entire lineage for a product.
| Parameter | Type | Description |
|---|---|---|
upstream_ids | list[UUID] | None | Upstream dependency product UUIDs |
downstream_ids | list[UUID] | None | Downstream dependency product UUIDs |
Returns: Product
await client.lineage.set_lineage(
"analytics",
product_id,
upstream_ids=[raw_events_id, user_profiles_id],
)
impact_analysis(space_slug, product_id, *, depth=3)
Analyze downstream impact of changes to a product, including cross-space consumers.
| Parameter | Type | Default | Description |
|---|---|---|---|
depth | int | 3 | Max hop depth |
Returns: ImpactAnalysis with impacted_products, impacted_contracts, total_impacted
impact = await client.lineage.impact_analysis("analytics", product_id)
print(f"Impacted: {impact.total_impacted} products")
for p in impact.impacted_products:
print(f" → {p.name} (owner: {p.owner.name})")
graph(space_slug, *, environment=, include_cross_space=True)
Get the full lineage graph for a space.
| Parameter | Type | Default | Description |
|---|---|---|---|
environment | str | None | None | Filter by environment |
include_cross_space | bool | True | Include cross-space connections |
Returns: LineageGraph with nodes and edges