Commit 4e24cac
Fix CI failure: cast treatment to float before injecting non-integer D in test
`tests/test_chaisemartin_dhaultfoeuille.py::TestByPathNonBinary::test_non_integer_D_raises`
failed across all 7 CI runners (macos py3.11/3.14, ubuntu-24.04-arm
py3.11/3.13/3.14, ubuntu-latest py3.14, windows-latest py3.11) with:
TypeError: Invalid value '1.5' for dtype 'int64'
The fixture builds `df["treatment"]` as integers in {0, 1, 2}, so the
column dtype is int64. On pandas >= 2.x (the version pinned in CI for
py3.11+ runners), `df.loc[mask, "treatment"] = 1.5` raises TypeError
outright; on older pandas (the local dev env) it emitted a
FutureWarning and proceeded. The test path was supposed to exercise
the estimator's D-integer guard at fit-time, not pandas's dtype
coercion behavior.
Cast `df["treatment"]` to float before injecting 1.5 so the test
behaves identically across pandas versions and reaches the
ValueError raise it was written to verify.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f97ab76 commit 4e24cac
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8208 | 8208 | | |
8209 | 8209 | | |
8210 | 8210 | | |
8211 | | - | |
| 8211 | + | |
| 8212 | + | |
| 8213 | + | |
| 8214 | + | |
| 8215 | + | |
| 8216 | + | |
8212 | 8217 | | |
8213 | 8218 | | |
8214 | 8219 | | |
| |||
0 commit comments