Skip to content

Commit 1fa4bbf

Browse files
committed
CLN: Drop the buffer_lines parameter in read_csv
Deprecated back in 0.19.0 xref pandas-devgh-13360.
1 parent b6a7cc9 commit 1fa4bbf

File tree

5 files changed

+3
-19
lines changed

5 files changed

+3
-19
lines changed

doc/source/io.rst

-5
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ low_memory : boolean, default ``True``
199199
Note that the entire file is read into a single DataFrame regardless,
200200
use the ``chunksize`` or ``iterator`` parameter to return the data in chunks.
201201
(Only valid with C parser)
202-
buffer_lines : int, default None
203-
.. deprecated:: 0.19.0
204-
205-
Argument removed because its value is not respected by the parser
206-
207202
compact_ints : boolean, default False
208203
.. deprecated:: 0.19.0
209204

doc/source/whatsnew/v0.22.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ Removal of prior version deprecations/changes
227227
- ``DatetimeIndex.to_datetime``, ``Timestamp.to_datetime``, ``PeriodIndex.to_datetime``, and ``Index.to_datetime`` have been removed (:issue:`8254`, :issue:`14096`, :issue:`14113`)
228228
- :func:`read_csv` has dropped the ``skip_footer`` parameter (:issue:`13386`)
229229
- :func:`read_csv` has dropped the ``as_recarray`` parameter (:issue:`13373`)
230+
- :func:`read_csv` has dropped the ``buffer_lines`` parameter (:issue:`13360`)
230231

231232
.. _whatsnew_0220.performance:
232233

pandas/_libs/parsers.pyx

+1-2
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ cdef class TextReader:
360360
allow_leading_cols=True,
361361
use_unsigned=False,
362362
low_memory=False,
363-
buffer_lines=None,
364363
skiprows=None,
365364
skipfooter=0,
366365
verbose=False,
@@ -557,7 +556,7 @@ cdef class TextReader:
557556
if not self.table_width:
558557
raise EmptyDataError("No columns to parse from file")
559558

560-
# compute buffer_lines as function of table width
559+
# Compute buffer_lines as function of table width.
561560
heuristic = 2**20 // self.table_width
562561
self.buffer_lines = 1
563562
while self.buffer_lines * 2 < heuristic:

pandas/io/parsers.py

-9
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,6 @@
273273
Note that the entire file is read into a single DataFrame regardless,
274274
use the `chunksize` or `iterator` parameter to return the data in chunks.
275275
(Only valid with C parser)
276-
buffer_lines : int, default None
277-
.. deprecated:: 0.19.0
278-
This argument is not respected by the parser
279276
compact_ints : boolean, default False
280277
.. deprecated:: 0.19.0
281278
Argument moved to ``pd.to_numeric``
@@ -503,7 +500,6 @@ def _read(filepath_or_buffer, kwds):
503500
'use_unsigned': False,
504501
'low_memory': True,
505502
'memory_map': False,
506-
'buffer_lines': None,
507503
'error_bad_lines': True,
508504
'warn_bad_lines': True,
509505
'tupleize_cols': False,
@@ -518,18 +514,15 @@ def _read(filepath_or_buffer, kwds):
518514
_c_unsupported = {'skipfooter'}
519515
_python_unsupported = {
520516
'low_memory',
521-
'buffer_lines',
522517
'float_precision',
523518
}
524519

525520
_deprecated_defaults = {
526-
'buffer_lines': None,
527521
'compact_ints': None,
528522
'use_unsigned': None,
529523
'tupleize_cols': None
530524
}
531525
_deprecated_args = {
532-
'buffer_lines',
533526
'compact_ints',
534527
'use_unsigned',
535528
'tupleize_cols',
@@ -606,7 +599,6 @@ def parser_f(filepath_or_buffer,
606599
compact_ints=None,
607600
use_unsigned=None,
608601
low_memory=_c_parser_defaults['low_memory'],
609-
buffer_lines=None,
610602
memory_map=False,
611603
float_precision=None):
612604

@@ -676,7 +668,6 @@ def parser_f(filepath_or_buffer,
676668
warn_bad_lines=warn_bad_lines,
677669
error_bad_lines=error_bad_lines,
678670
low_memory=low_memory,
679-
buffer_lines=buffer_lines,
680671
mangle_dupe_cols=mangle_dupe_cols,
681672
tupleize_cols=tupleize_cols,
682673
infer_datetime_format=infer_datetime_format,

pandas/tests/io/parser/test_unsupported.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ def read(self):
128128
class TestDeprecatedFeatures(object):
129129

130130
@pytest.mark.parametrize("engine", ["c", "python"])
131-
@pytest.mark.parametrize("kwargs", [{"buffer_lines": True},
132-
{"buffer_lines": False},
133-
{"compact_ints": True},
131+
@pytest.mark.parametrize("kwargs", [{"compact_ints": True},
134132
{"compact_ints": False},
135133
{"use_unsigned": True},
136134
{"use_unsigned": False},

0 commit comments

Comments
 (0)