@@ -408,30 +408,32 @@ class _read_shared(TypedDict, Generic[HashableT], total=False):
408
408
documentation for more details.
409
409
on_bad_lines : {{'error', 'warn', 'skip'}} or Callable, default 'error'
410
410
Specifies what to do upon encountering a bad line (a line with too many fields).
411
- Allowed values are :
411
+ Allowed values are:
412
412
413
413
- ``'error'``, raise an Exception when a bad line is encountered.
414
414
- ``'warn'``, raise a warning when a bad line is encountered and skip that line.
415
415
- ``'skip'``, skip bad lines without raising or warning when they are encountered.
416
+ - Callable, function that will process a single bad line.
417
+ - With ``engine='python'``, function with signature
418
+ ``(bad_line: list[str]) -> list[str] | None``.
419
+ ``bad_line`` is a list of strings split by the ``sep``.
420
+ If the function returns ``None``, the bad line will be ignored.
421
+ If the function returns a new ``list`` of strings with more elements than
422
+ expected, a ``ParserWarning`` will be emitted while dropping extra elements.
423
+ - With ``engine='pyarrow'``, function with signature
424
+ as described in `pyarrow documentation
425
+ <https://arrow.apache.org/docs/python/generated/pyarrow.csv.ParseOptions.html
426
+ #pyarrow.csv.ParseOptions.invalid_row_handler>`_.
416
427
417
428
.. versionadded:: 1.3.0
418
429
419
430
.. versionadded:: 1.4.0
420
431
421
- - Callable, function with signature
422
- ``(bad_line: list[str]) -> list[str] | None`` that will process a single
423
- bad line. ``bad_line`` is a list of strings split by the ``sep``.
424
- If the function returns ``None``, the bad line will be ignored.
425
- If the function returns a new ``list`` of strings with more elements than
426
- expected, a ``ParserWarning`` will be emitted while dropping extra elements.
427
- Only supported when ``engine='python'``
432
+ Callable
428
433
429
434
.. versionchanged:: 2.2.0
430
435
431
- - Callable, function with signature
432
- as described in `pyarrow documentation
433
- <https://arrow.apache.org/docs/python/generated/pyarrow.csv.ParseOptions.html
434
- #pyarrow.csv.ParseOptions.invalid_row_handler>`_ when ``engine='pyarrow'``
436
+ Callable for ``engine='pyarrow'``
435
437
436
438
delim_whitespace : bool, default False
437
439
Specifies whether or not whitespace (e.g. ``' '`` or ``'\\ t'``) will be
0 commit comments