NeuroNomixer
  • Home
  • Blog
  • Visual Guides
  • Authors
  • Contact
Sign InSign Up
HomeBlogAuthorsContactPrivacy Policy

© 2026 NeuroNomixer — Built with Next.js & Tailwind CSS

Visual Guides/Guardrails for Data: Validation Rules
Data & Analysis

Guardrails for Data: Validation Rules

A quality check that lives in someone's head protects nothing. Here you turn a data contract into executable rules, run corrupted batches through a three-stage pipeline, and watch exactly what one switched-off rule costs the dashboard at the end.

Watch bad rows break the chart
Catch all 6 defects in one run
Toggle a rule off, re-run, and watch a defect escape

Sign in to save progress

From quality talk to quality gates

The six dimensions of data quality name what good data means. This guide is about enforcement: each expectation becomes a small executable predicate (type, range, not_null, unique, relationship) that runs against every incoming batch and quarantines whatever fails, the same idea behind tests in tools like dbt or Great Expectations. The difference between a documented standard and a validation rule is that the rule cannot forget to check. It sits inside the pipeline as a gate, and the pipeline does not move data past it.

How this playground stays honest: the three batches (24 rows, 6 of them defective) are fixed fixtures you can read cell by cell in section 1. Every caught and escaped count comes from executing your enabled rules against those rows, and every bar on the dashboard is a live sum over the rows that actually passed your gate. Nothing is faked.

1 · The contract and the raw batches

An orders feed lands three times, once per day. The data dictionary says what every column must look like; the batches say what actually arrived. Inspect both. Some cells break the contract, and finding them by eye is the last time anyone should have to.

Data dictionary: the orders contract

order_id : string

Order key, format ORD-1xxx. Must be unique: one row per order.

customer_id : string

Required. Must exist in the customers reference table.

amount : number

Order value in dollars. Valid orders are 5 to 500.

quantity : integer

Items in the order, 1 to 10.

Customers reference table

C-101 AylinC-102 BramC-103 ChidiC-104 DaraC-105 EmreC-106 Farah

These 6 ids are the only customers that exist. A relationship rule checks incoming customer_id values against this table.

The raw batches, exactly as they will arrive

order_idcustomer_idamountquantity
ORD-1001C-10342.51
ORD-1002C-101129.992
ORD-1003C-105881
ORD-1004C-102N/A1
ORD-1005C-104260.753
ORD-1006C-10619.991
ORD-1007C-1012500002
ORD-1008C-103310.44

Read each batch against the dictionary on the left. Some cells break the contract: a value with the wrong type, a number outside its range, a missing key, a replayed order, an id no reference table has heard of. Nothing here is highlighted for you, because nothing will be highlighted in production either. The rules you write in section 2 are what does the noticing.

2 · Write the schema rules

Translate the dictionary into rules. Each one is a real predicate: when the pipeline runs, every enabled rule executes against every row, and one failure is enough to quarantine the row. Rules are deliberately narrow. A range check shrugs at text, a type check shrugs at nulls, so coverage comes from the set, not from any single rule.

Rule builder

The value must match the column's declared type. Nulls pass; missingness is not_null's job.

Your schema: 0 rules, 0 enabled

No rules yet. The gate is wide open: every row, valid or not, will sail straight into the warehouse. Run the pipeline once like this to see what that costs, then come back and write the contract down as rules.

This is how pipeline testing tools like dbt think about quality: each expectation from the data dictionary becomes one small executable test, and the set of tests is the schema. The OFF switch exists because the most common failure in real teams is not a missing rule; it is a rule someone silenced during an incident and never turned back on.

3 · Run the pipeline

Extract, validate, load: the three batches flow through the gate in order, and whatever survives your rules becomes the revenue dashboard on the right.

Start unguarded: run the pipeline in section 3 before writing a single rule, and look closely at what reaches the dashboard.

Caught: 0False alarms: 0Escaped: 0Loaded: 0

Each run rebuilds the warehouse from scratch with your current rule set, like a scheduled pipeline job. Caught means a defective row was quarantined; false alarms means a contract-valid row was quarantined by mistake; escaped means a defective row passed every enabled rule.

Stage 1 · Extract

Day 1 · 8 rowsQueued
Day 2 · 8 rowsQueued
Day 3 · 8 rowsQueued

The three fixture batches from section 1, replayed in order.

Stage 2 · Validation gate

0 rules armed

Nothing in the gate yet. Every enabled rule runs against every row of each batch; one failed rule is enough to quarantine a row.

Stage 3 · Warehouse and dashboard

0 rows in the warehouse

$0$503$1,007Day 1Day 2Day 3

Dashed gold line: revenue from contract-valid rows only, the number this chart should show. Bars turn orange when they drift from it.

    Quarantine · 0 rows

    Empty. Rows land here when an enabled rule catches them, tagged with the rule that fired.

    ← All GuidesNext Guide →