You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Codex CI R7 P1: extend shared validator to check cluster column existence
P1 (Code Quality) [new in R7] — `cluster=<col>` is load-bearing on the
Conley combined-kernel paths (Wave A #119) but none of DiD / MPD / TWFE
validated that the named cluster column exists in `data` before the
downstream `data[self.cluster]` access. A typo like
`cluster="missing_region"` fell through to a raw pandas KeyError
instead of the estimator-level ValueError pattern the rest of the
Conley validation surface now uses.
Same class as R1's unit-column guard and R2/R6's conley_coords guard:
extends the shared `_validate_conley_estimator_inputs` helper added
in R6 with an 8th check `if cluster is not None and cluster not in
data.columns: raise ValueError("Cluster column ... not found in data")`.
The three call sites in DiD/MPD/TWFE now pass `cluster=self.cluster`
through and pick up the new guard via one-line opt-in. Future Conley
surfaces that add cluster support get the validator's behavior for
free.
Tests: regressions on all three estimator surfaces (DiD/MPD/TWFE)
asserting `cluster="missing_region"` raises the estimator-level
ValueError before any pandas-level error.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments