Skip to main content
Three generic dbt/dbt_expectations test kinds, individually small but sharing one job: bounding what a column is allowed to contain. Where Structural asks “does this row exist exactly once,” this group asks “is this value physically or logically possible.”
Anything that’s a fraction, a share, or a probability is range-tested to [0, 1] int_lap_telemetry_aggregates’s throttle/DRS/wheelspin/lift-coast shares (via accepted_range), int_sc_hazard_history’s per-lap SC/VSC/any hazard rates in both raw and shrunk form, and the confidence scores that travel with every shrinkage estimate (affinity_confidence, rating_confidence, tax_calibration_confidence, optimal_pit_lap_confidence, ghost-car recombination_confidence). A value outside [0, 1] here isn’t a plausibility judgment call it’s a unit-error or an off-by-one in a shrinkage formula, full stop.
Pace and degradation deltas are bounded to a range wide enough to admit every legitimate outlier (a wet race, a mid-season driver swap) without admitting a decomposition that’s silently blown up. dirty_air_tax_s, the deg-sensitivity slopes (deg_slope_s_per_lap, deg_slope_raw_s_per_lap, and their standard errors), the cliff-onset shift, and both pit-loss estimates (pit_loss_s_empirical, pit_loss_s_shrunk) are each bounded this way wide enough to be honest, narrow enough that a coefficient many multiples outside history fails the build instead of silently propagating into a feature mart.
accepted_values pins every categorical column to the exact label set the rest of the codebase switches on these sets are themselves gate-checked (a typo’d label fails the build, not a downstream CASE that silently falls through to a default):
Four expect_column_pair_values_A_to_be_greater_than_B tests assert that two related columns stay in the order their meaning requires. int_constructor_structural_pace’s confidence interval must have constructor_structural_pace_ci_high_s ≥ constructor_structural_pace_ci_low_s this is also the test that supersedes the now-placeholder assert_constructor_confidence_monotone singular test, since the model it guarded was folded into this one and re-grained from lap-level to race-level. mart_degradation_history_envelope’s three fuel-removed pace percentiles are pinned to their statistical order: p90 ≥ p50 ≥ p10.

Every model, by range & domain test count