- not_null
- unique
- unique_combination_of_columns
The most common test in the suite. Declared on every column a downstream model or the app is allowed to assume is populated a surrogate key, a foreign key, a physics component that’s supposed to exist on every valid lap. A
not_null failure means either an upstream join silently dropped rows it shouldn’t have, or a column that’s genuinely optional (and should read NULL downstream, like compound_component_s on a lap with no tyre data) had its test declared too strictly.Why the join spine can't fan out
Why the join spine can't fan out
Every model between
stg_laps and a feature mart joins back to the same lap, directly or transitively, by lap_id (or a sector/corner-grain extension of it). The unique test on every model’s grain key is what makes that join spine trustworthy: if any one of the ~30 models a lap passes through on its way to fct_lap_residuals silently duplicated a row, every downstream JOIN on that model would fan out, and a single lap’s contribution to a race-level or season-level aggregate would be counted more than once invisibly, since the duplicated rows would carry consistent-looking values. This is also what protects the identity itself: assert_lap_7term_identity checks that pace_delta_s equals the sum of six components plus the residual on every row of int_lap_residual_decomposed, but that check is only meaningful once per lap. A duplicated lap_id would pass the identity test twice instead of failing it once.