Field note · April 14, 2026

One question I ask in every code review

"What does one row of this represent?" — and what happens when nobody can answer.

1 min read ·Analytics engineering ·sql warehousing practice

I ask one question on every model review, before looking at the logic:

What does one row of this table represent?

If the answer takes more than a sentence, something is wrong. If the answer contains "usually" or "unless", something is definitely wrong.

Good answers:

  • One row per completed trip.
  • One row per account, as of the extract date.
  • One row per city per day.
  • One row per user per experiment exposure.

Answers that mean stop:

  • "It depends on whether the order was split."
  • "One row per order, but multi-item orders have several."
  • "Order-level, mostly."

That last category describes a mixed-grain table, and it is the most damaging object in any warehouse. Every sum() on it is wrong by an amount that varies with how many sub-rows each parent has, and nothing anywhere raises an error. It produces numbers that are plausible, consistent, and off by 30%.

Once the grain sentence exists, two things follow automatically. It goes in the model description, so the next person does not have to ask. And it becomes a test:

yaml
columns:
  - name: order_line_key
    tests: [unique, not_null]

That test is the grain sentence, in executable form. If the sentence is true, the test passes. If someone later breaks it — a join that fans out, a source that starts double-delivering — the test fails on the next run rather than six weeks later in a board deck.

One question, one sentence, one test. It is the cheapest quality intervention available and I have never regretted asking it, including the several times the answer was "…huh".