One aggregate over a column with holes returns a number and another returns absence — where is that choice made?
answer
- not a property of the data
- per call, not per session
- the surface's author chose the default
- two surfaces in one tool can disagree
- write the flag out where it is reported
basics
~20 sPer call, by a flag whose default the library author set surface by surface. Nothing in the data decides it: the same column can yield a number on one surface and absence on another, in one tool and one session.
solid answer
~50 sThe setting is the skip-absent flag — the per-call switch deciding whether an aggregate steps over the holes or hands absence back — and what varies between tools is only which way it is defaulted. Some column-aggregate surfaces default to skipping, so you get a number and must ask for propagation. Some default to propagating, so one hole makes the entire answer absent until you ask for the holes to be removed, and that is an ecosystem's default rather than an edge case. On a plain rectangle of numbers carrying no row labels, the ordinary reduction commonly propagates while a separately named absence-aware reduction is the one that skips. So the model that travels across tools is not a direction but a habit: wherever a result is reported, write the flag out instead of inheriting it.
go deeper
Know that whether holes are stepped over is a setting rather than a fact about the data, and that a colleague's example from another tool may behave the opposite way on the surface in front of you.
Name the flag by what it does, state both default directions, and say which one is more dangerous and why — the silent one, because it returns a believable number rather than a visible gap.
Show the operating discipline: the flag written out at every reporting boundary, a fixture with a known hole in the tests, and the count of present values travelling beside the number so a wrong default is visible.
Argue the standing rule rather than the call. Requiring the flag everywhere is noise; requiring it only where a number leaves the process is cheap, enforceable in review, and bounds the blast radius of an unfamiliar default.
## The setting, and where it actually lives The **skip-absent flag** is the per-call setting deciding whether an aggregate steps over the holes or hands back absence. Three facts about it do all the work: 1. It is **per call**. It is not a property of the column, not a property of the table, and in general not a session-wide mode. One column, aggregated on two adjacent lines, can answer two different ways. 2. Its **default is chosen per surface**, by whoever wrote that surface. Surfaces inside one tool are written for different jobs and are under no obligation to agree with each other. 3. Some surfaces **do not expose it at all**. There the default is the only behaviour, and the way round it is to prepare the data rather than to pass an argument. ## Why the defaults genuinely differ - A column aggregate on a **two-dimensional labelled table** — a rectangle of columns where every column has one type and the rows carry an identity of their own — is aimed at real-world data where holes are expected. Skipping makes the common case work, at the price of silence. - A reduction over a **plain numeric array** — a rectangle of numbers all of one width, with no row labels attached — is aimed at dense numeric work where a hole is usually a bug. Propagating makes the bug loud, and these tools typically offer a separately named absence-aware reduction for when it is not a bug. - An entire ecosystem may default to propagating even on tabular data, on the principle that an unknown input yields an unknown answer and the analyst should have to say what to do about it. None of those three is wrong. What is wrong is carrying one of them across a boundary as though it were the rule. | Surface family | Default when a hole is present | How you get the other behaviour | |---|---|---| | Column aggregate defaulting to skipping | a number, computed over fewer values | set the flag so absence propagates | | Column aggregate defaulting to propagating | absence | set the flag so the holes are removed | | Plain reduction over a rectangle of numbers | absence, or the undefined-arithmetic result | call the separately named absence-aware reduction | That table is the reason a candidate who states one direction as the rule is marked down, and a candidate who names two directions and says which is more dangerous is marked up. The **skipping** default is the dangerous one, because it is the one that produces a plausible number with no signal attached. ## What the flag does not fix - **It does not give two calls a shared population.** It governs one aggregate over one column. A statistic reading two columns still skips per column, and each of the two numbers ends up over its own set of rows. - **It is not the minimum-present threshold.** That is a separate setting: having stepped over the holes, it makes the fold return absence unless at least that many real values took part. One decides whether holes are skipped; the other decides whether the survivors were enough to report a number at all. - **It does not govern what a filter, an ordering or a key match does with absence.** Those surfaces have their own rules, and the flag on an aggregate says nothing about them. - **It leaves no trace.** Flipping it changes the answer and changes nothing visible in the output. ## The habit that travels Since nobody can memorise a matrix of surfaces across three ecosystems, adopt a rule rather than a lookup: 1. Wherever a number **leaves the process** — a report, a written file, a chart, an alert — write the flag out rather than inherit it. 2. Pair the number with the **count of present values** it was computed over, so a wrong default shows up as an unexpected denominator instead of as a believable number. 3. Put one fixture with a known hole into the tests for any transform whose output is reported. Every default in play is then pinned by an assertion instead of by somebody's memory of a tool they used last year. 4. In review, treat an aggregate over a column known to contain holes, with no flag written, as a **question to ask** — not automatically a defect, but never automatically fine either. The cost of this discipline is a few characters per call site. The cost of not having it is that the correctness of a reported number depends on which surface a colleague happened to reach for. ## In an interview The answer that lands is short: per call, and the default is the surface author's choice, so I write it out where the result matters. Then give both directions rather than one. The interviewer may well have come up in a different ecosystem from you, and what they are listening for is whether you know that your own default is a default.
- What does the minimum-present threshold add on top of the skip-absent flag?It is a separate setting. Having stepped over the holes, it makes the fold return absence unless at least that many real values took part. The flag decides whether holes are skipped at all; the threshold decides whether the survivors were enough to justify reporting a number.
- How do you stop a team quietly depending on whichever default happens to be in force?Make it explicit at the boundary where a number leaves the process, and pair every reported aggregate with the count it was computed over. A wrong default then shows as a denominator nobody expected rather than as a plausible figure, and one fixture with a hole pins the behaviour in tests.
- Why is the skipping default considered the more dangerous of the two?Because it succeeds. A propagating default hands back absence, which renders as a gap and gets investigated within minutes. A skipping default hands back a number of the right type and roughly the right magnitude, and it will be copied into a slide before anyone asks what it was divided by.
saying these in an interview costs you the question
- Says every aggregate skips absent values by default
- Assumes one tool's default holds on every surface inside it
- Thinks the flag is a session-wide or table-wide setting
- Treats a propagating aggregate as a bug in the tool
- Believes the flag also repairs a statistic reading two columns
- Confuses the skip flag with the minimum-present threshold