Data Quality, PII and Trust
A pipeline that quietly drops a day of data is worse than one that errors. Know the handful of tests that catch most problems, and treat PII and consent as first-order for users like pregnant women, farmers and children.
Tests that catch most real problems
dbt-style tests, in rough order of value:
- unique and not_null on every primary key (messageid, userid)
- relationships: every message's user_id exists in users
- accepted_values on enums (direction in 'in','out')
- freshness: alert if the newest row is older than expected
- reconciliation: warehouse counts roughly match the source system's own counts
- volume anomaly: today's row count within a normal range of recent days
A job that reports "success" does not mean the data is complete. Prefer freshness and volume checks over only checking the job ran.
Debugging a surprising number
When a number moves suddenly (say DAU drops 35% overnight):
- 1.Rule out a data problem before explaining behavior. Check freshness and row counts for the affected date against the source
- 2.Check for schema changes at the source (renamed field, new event name)
- 3.Check timezone or cutoff boundaries
- 4.Check filters that changed (a bot filter now excluding real users)
- 5.Only then look for real behavior change, by segment
Saying this order out loud is exactly what a live exercise rewards.
Latent weakness in a position that has not yet been exploited. Silent pipeline failures are aji: nothing looks wrong until a decision gets made on bad numbers.
PII, consent and responsible data use
Users here include pregnant women, new parents, children and farmers. Free-text messages may contain health details.
- Minimize: collect only what the program needs
- Pseudonymize: hash identifiers; keep the mapping, if any, restricted
- Restrict access to raw message text; most analysis needs aggregates
- Retention limits: delete or archive on a schedule
- Be explicit about what data is used for model evaluation or training, and confirm consent covers it
- Check local data-protection law with the grantee rather than assuming
Real conversations make the best eval sets, so the answer to "can we use real messages?" is "yes, safely," not "no."
Select any text in the lesson to ask a question. Press Esc to close.