-
-
Notifications
You must be signed in to change notification settings - Fork 19k
Commit 7502a61
committed
BUG: read_csv(on_bad_lines=callable)+index_col should warn; add test
- Always emit ParserWarning and drop extra fields when an on_bad_lines
callable returns more elements than expected, regardless of index_col,
in PythonParser._rows_to_cols. [GH#61837]
- Ensure non-bad rows are appended in the outer else branch so good lines
are preserved.
- Add regression test
pandas/tests/io/parser/test_python_parser_only.py::test_on_bad_lines_callable_warns_and_truncates_with_index_col
covering index_col in [None, 0].
Closes #61837.1 parent d4bac86 commit 7502a61
File tree
2 files changed
+52
-2
lines changed- pandas
- io/parsers
- tests/io/parser
2 files changed
+52
-2
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1189 | 1189 |
| |
1190 | 1190 |
| |
1191 | 1191 |
| |
1192 | - | ||
1193 | 1192 |
| |
1194 | 1193 |
| |
1195 | 1194 |
| |
1196 | 1195 |
| |
1196 | + | ||
1197 | + | ||
1198 | + | ||
1199 | + | ||
1200 | + | ||
1201 | + | ||
1202 | + | ||
1203 | + | ||
1204 | + | ||
1197 | 1205 |
| |
1198 | 1206 |
| |
1199 | 1207 |
| |
1200 | 1208 |
| |
1201 | 1209 |
| |
1202 | 1210 |
| |
1203 | 1211 |
| |
1204 | - | ||
1205 | 1212 |
| |
1206 | 1213 |
| |
1214 | + | ||
1215 | + | ||
1207 | 1216 |
| |
1208 | 1217 |
| |
1209 | 1218 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
562 | 562 |
| |
563 | 563 |
| |
564 | 564 |
| |
565 | + | ||
566 | + | ||
567 | + | ||
568 | + | ||
569 | + | ||
570 | + | ||
571 | + | ||
572 | + | ||
573 | + | ||
574 | + | ||
575 | + | ||
576 | + | ||
577 | + | ||
578 | + | ||
579 | + | ||
580 | + | ||
581 | + | ||
582 | + | ||
583 | + | ||
584 | + | ||
585 | + | ||
586 | + | ||
587 | + | ||
588 | + | ||
589 | + | ||
590 | + | ||
591 | + | ||
592 | + | ||
593 | + | ||
594 | + | ||
595 | + | ||
596 | + | ||
597 | + | ||
598 | + | ||
599 | + | ||
600 | + | ||
601 | + | ||
602 | + | ||
603 | + | ||
604 | + | ||
605 | + |
0 commit comments