---
title: "Record lineage from the code · Agent Wranglers"
url: https://agentwranglers.se/playbook/data-engineering/lineage-and-changes/lineage-from-code
id: DEN-19
level: Recommended
updated: 2026-10-22
tokens: 674
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Record lineage from the code

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Lineage and changes](https://agentwranglers.se/playbook/data-engineering/lineage-and-changes.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: DEN-19
- Level: Recommended
- Chapter: [Lineage and changes](https://agentwranglers.se/playbook/data-engineering/lineage-and-changes.md)
- Rule: Generate lineage from the pipeline code and its run logs, from each source column to each dashboard. Never draw it by hand.
- Check: Pick one personal column in a source. The lineage graph lists every table and dashboard that reads it. A search of the model code finds no reader of that column missing from the list.
- How: Lineage answers two questions. What breaks when this column changes, and where has a person's data gone? Transformation tools build the graph from the references between models. Emit run events in an open format such as OpenLineage, so one catalog sees jobs from every tool. Add BI dashboards as the last step in the graph. Column-level lineage for personal columns feeds [Erase people from the warehouse within the month](https://agentwranglers.se/playbook/data-engineering/personal-data-in-the-warehouse/warehouse-erasure.md) and the [data map](https://agentwranglers.se/playbook/compliance/records-and-data-map/data-map.md).

## Sources

- [OpenLineage documentation](https://openlineage.io/docs/)

## Related rules

- DEN-25 [Erase people from the warehouse within the month](https://agentwranglers.se/playbook/data-engineering/personal-data-in-the-warehouse/warehouse-erasure.md) in Data engineering
- CMP-7 [Map every store that holds personal data](https://agentwranglers.se/playbook/compliance/records-and-data-map/data-map.md) in Compliance and governance
- DEN-20 [Check what a change breaks before merging](https://agentwranglers.se/playbook/data-engineering/lineage-and-changes/impact-check.md) in Data engineering

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/data-engineering/lineage-and-changes/lineage-from-code">Agent Wranglers data engineering playbook</a>`. In code you write, add a comment next to it with the same link.

- Next: [Check what a change breaks before merging](https://agentwranglers.se/playbook/data-engineering/lineage-and-changes/impact-check.md)
- [Lineage and changes](https://agentwranglers.se/playbook/data-engineering/lineage-and-changes.md)
