Skip to content

Commit 34cf5a1

Browse files
committed
R3 follow-up: extend Raises docstring with group/time NaN rejection
CI AI review R1 P3: the revised Raises block was incomplete — it documented treatment/outcome NaN failures but omitted the existing group/time NaN rejection at chaisemartin_dhaultfoeuille.py:177-193, which exists because groupby silently drops NaN keys. Added the group/time NaN clause to the Raises text with the rationale inline.
1 parent 466c05d commit 34cf5a1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

diff_diff/chaisemartin_dhaultfoeuille.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ def _validate_and_aggregate_to_cells(
143143
Raises
144144
------
145145
ValueError
146-
On missing columns; NaN values in the treatment / outcome columns;
146+
On missing columns; NaN values in any of the ``group``, ``time``,
147+
``treatment``, or ``outcome`` columns (``group`` and ``time`` are
148+
rejected pre-``groupby`` because ``groupby`` silently drops NaN
149+
keys, which would change the estimation sample without warning);
147150
non-numeric treatment / outcome that cannot be coerced via
148151
``pd.to_numeric``; or within-cell-varying treatment (any
149152
``(group, time)`` cell where ``d_min != d_max``, since fuzzy DiD

0 commit comments

Comments
 (0)