Commit 888d598
BUG: Raise OutOfBoundsDatetime instead of silently upcasting in replace (pandas-dev#61671)
The previous fix silently widened datetime64[ns] to datetime64[us], which
could truncate sub-microsecond data. Instead, raise OutOfBoundsDatetime
with a message telling the user to explicitly cast before operating.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent b11d3c6 commit 888d598
6 files changed
Lines changed: 19 additions & 25 deletions
File tree
- doc/source/whatsnew
- pandas
- core
- dtypes
- internals
- tests
- dtypes
- frame/methods
- series/methods
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1206 | 1206 | | |
1207 | 1207 | | |
1208 | 1208 | | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
1223 | 1209 | | |
1224 | 1210 | | |
1225 | 1211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
440 | 449 | | |
441 | 450 | | |
442 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2158 | 2158 | | |
2159 | 2159 | | |
2160 | 2160 | | |
2161 | | - | |
2162 | | - | |
2163 | | - | |
2164 | | - | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
2165 | 2164 | | |
2166 | 2165 | | |
2167 | 2166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
1473 | 1474 | | |
1474 | 1475 | | |
1475 | 1476 | | |
1476 | | - | |
1477 | | - | |
1478 | | - | |
| 1477 | + | |
| 1478 | + | |
1479 | 1479 | | |
1480 | 1480 | | |
1481 | 1481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
745 | 746 | | |
746 | 747 | | |
747 | 748 | | |
748 | | - | |
749 | | - | |
750 | | - | |
| 749 | + | |
| 750 | + | |
0 commit comments