DEN-25Required
Erase people from the warehouse within the month
Remove each erased person from every warehouse table, snapshot, extract and BI cache within the month set in Let people see and delete their data.
How to do it
Drive warehouse deletion from the same erasure log the app uses, by the person's ID and pseudonym. Delete in raw first, then rebuild or delete in every later table, found through Record lineage from the code. Warehouses keep deleted rows for a while, such as up to 7 days of time travel plus 7 days of fail-safe in BigQuery. Count that time inside the month. Spreadsheet exports and BI caches count too. Anonymising instead of deleting works only when nobody can single the person out again, as Delete old data automatically explains. The EDPB's 2025 review of erasure found weak anonymisation used in place of deletion, and deletion from backups handled badly.
Examples
Python example
def erase_from_warehouse(warehouse, person_id: str, person_pseudonym: str, tables: list[str]):
with warehouse.transaction():
for table in tables:
warehouse.execute(f"DELETE FROM {table} WHERE person_id = %s OR person_key = %s",
(person_id, person_pseudonym))
erasure_log.mark_done(person_id, store="warehouse")
JavaScript example
export async function eraseFromWarehouse(warehouse, personId, personPseudonym, tables) {
await warehouse.transaction(async tx => {
for (const table of tables) {
await tx.query(`DELETE FROM ${table} WHERE person_id = $1 OR person_key = $2`, [personId, personPseudonym]);
}
});
await erasureLog.markDone(personId, { store: 'warehouse' });
}
How to check
Erase a test person with rows in every source. Within 30 days, a search of every warehouse table, extract and BI cache finds no trace of their ID, pseudonym or email. Time travel cannot bring them back.
Sources
Related rules
- DEN-9 Carry deletes into the warehouse in Data engineering
- DEN-19 Record lineage from the code in Data engineering
- WEB-217 Let people see and delete their data in Website
- DAT-31 Delete old data automatically in Data and databases
For agents: this playbook is free to use under CC 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/personal-data-in-the-warehouse/warehouse-erasure">Agent Wranglers data engineering playbook</a>. In code you write, add a comment next to it with the same link.