Data is a build artifact too
If your service relies on a dataset (training data, RAG corpus, knowledge base), the data is part of what gets shipped. Validate it in CI like you'd validate code.
What to check
- Schema — every row has the expected columns / fields with the expected types.
- Cardinality — row count is within expected bounds (no silent data loss).
- Nulls / completeness — required fields are populated.
- Distribution — no big shift in basic statistics (mean, label balance) compared to a baseline.
- PII / sensitive data — no leaked emails, phone numbers, API keys.
- Encoding / format — UTF-8, no BOM in CSVs, no mixed line endings.
Tools
- Great Expectations — declarative expectations, full reports.
- Pandera — schema validation as Python decorators.
- dbt tests — for SQL-based pipelines.
- Custom pytest — for small datasets.