Ernest Goes to AIernestofgaia.xyz →

Two Wrong Numbers: One I Caught, One I Nearly Published

4 min read
A row of potted seedlings under fine isolation bags on a greenhouse workbench. One pot is empty but still carries a neatly filled-in record tag; a healthy seedling further along carries two identical tags on separate strings. No people in frame.

Two Wrong Numbers: One I Caught, One I Nearly Published

Four bugs got through review in the first build session. Every one of them looked fine — read the code and you'd approve it, because Claude did. Then they touched the real dataset.

I want to walk through them, because the last one is different from the rest in a way that took me a while to see.

The four

The rows with no date. Some rows arrive with an empty date field. Empty date goes into a date calculation and returns NaN — not a number. Then it spreads: anything you add it to becomes NaN too, so one blank cell can quietly take a whole column with it.

The field that said "No" instead of "N". A query filtered on a yes/no field. The code assumed the value was N. The dataset says No. N never matches No, so the filter matched nothing, and the page cheerfully reported that Oregon has zero licensed cannabis businesses. No error, no warning, the query ran perfectly and returned an empty set, and an empty set renders as a very tidy zero.

The filter that thought beer was cannabis news. A news filter pulled stories matching the agency's name. The agency is the Oregon Liquor and Cannabis Commission, and it signs everything it does, including everything about alcohol. So a feed meant to track cannabis policy filled up with liquor licensing. The word "Cannabis" really was in the source. It just wasn't about cannabis.

The webfont that wasn't loading. The smallest one, and it's here because nothing announced it. The page rendered, the layout held, the type looked slightly off in a way that's easy to explain away. It had silently fallen back to a system font the whole time.

None of these are logic errors. They're one mistake in four outfits: verifying against how the code looks instead of against the live source.

The zero was the easy one

Zero licensed cannabis businesses in Oregon is absurd. It's a state with thousands. Anyone reading that number catches it in a second, including me, and the fix took a minute. A number that stupid is a gift. It announces itself.

Here's the one that didn't.

2,720 and 2,639

There are 2,720 active license rows in the state's file. There are 2,639 distinct licenses.

Both are true. They answer different questions, and only one of them is the question I thought I was asking.

The difference is renewals. When a license renews, the file carries both terms, the old and the new as separate rows. Count rows, and every recently renewed business gets counted twice. So "how many licensed cannabis businesses are there in Oregon?", answered by counting rows, invents about eighty businesses that do not exist.

Eighty-one out of 2,720 is a three percent error. And nothing about 2,720 looks wrong. It isn't round. It isn't absurd. It sits exactly where you'd expect a statewide license count to sit. If I'd published it, nobody would have queried it, including me.

The difference that matters

The zero and the 2,720 are the same bug. Both come from asking the data a slightly wrong question and believing the answer. Only one of them was rude enough to be obvious.

That's the part worth keeping: an absurd wrong number protects you. A plausible wrong number travels. It gets repeated, cited, built on, and by the time anyone checks, three other things depend on it.

What actually fixes it

Not being cleverer. Asking a duller question first: what is one row in this file?

I'd assumed one row was one business. One row is one licence term. Once that's stated plainly the bug is obvious, but I never stated it, because it felt too basic to bother with. Nearly everything that's gone wrong so far has been at exactly that level.

So the habits, all boring:

  • Print what you actually got, not what you expect to get.
  • Count rows before and after a filter.
  • Look at the distinct values in a field before writing a condition about it.
  • Count anything important two ways — total rows and distinct identifiers. If they disagree, the gap is telling you what a row actually means, and you need that before the number means anything.

That last one takes about a minute and has caught something every single time we've done it.

This data is free, public and complete. Anyone can download it right now. And it will still hand you a wrong answer if you ask a slightly wrong question, not by being misleading, but by being exactly what it says it is while you assume it's something slightly different.

Next time: a mistake I made about my own files, and what it cost to check.


Figures from Oregon's public cannabis market datasets via the state open-data portal, retrieved 2026-08-17. Licence counts are statewide and reflect that snapshot; the agency updates the file on its own schedule. Nothing here is financial, investment, or business advice, and nothing here is a recommendation about any position, purchase, or sale.

oregon-cannabispublic-dataverification
Two Wrong Numbers From One Dataset | Ernest of Gaia