Skip to content

Commit da12c9b

Browse files
jbrockmendelproost
authored andcommitted
DEPR: remove nthreads kwarg from read_feather (pandas-dev#29728)
1 parent 732e70b commit da12c9b

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

doc/source/whatsnew/v1.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
323323
- Removed previously deprecated :func:`pandas.tseries.plotting.tsplot` (:issue:`18627`)
324324
- Removed the previously deprecated ``reduce`` and ``broadcast`` arguments from :meth:`DataFrame.apply` (:issue:`18577`)
325325
- Removed the previously deprecated ``assert_raises_regex`` function in ``pandas.util.testing`` (:issue:`29174`)
326+
- Removed previously deprecated "nthreads" argument from :func:`read_feather`, use "use_threads" instead (:issue:`23053`)
326327
- Removed :meth:`Index.is_lexsorted_for_tuple` (:issue:`29305`)
327328
- Removed support for nexted renaming in :meth:`DataFrame.aggregate`, :meth:`Series.aggregate`, :meth:`DataFrameGroupBy.aggregate`, :meth:`SeriesGroupBy.aggregate`, :meth:`Rolling.aggregate` (:issue:`29608`)
328329
- Removed previously deprecated "order" argument from :func:`factorize` (:issue:`19751`)

pandas/io/feather_format.py

-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from distutils.version import LooseVersion
44

55
from pandas.compat._optional import import_optional_dependency
6-
from pandas.util._decorators import deprecate_kwarg
76

87
from pandas import DataFrame, Int64Index, RangeIndex
98

@@ -66,7 +65,6 @@ def to_feather(df: DataFrame, path):
6665
feather.write_feather(df, path)
6766

6867

69-
@deprecate_kwarg(old_arg_name="nthreads", new_arg_name="use_threads")
7068
def read_feather(path, columns=None, use_threads=True):
7169
"""
7270
Load a feather-format object from the file path.
@@ -89,11 +87,6 @@ def read_feather(path, columns=None, use_threads=True):
8987
If not provided, all columns are read.
9088
9189
.. versionadded:: 0.24.0
92-
nthreads : int, default 1
93-
Number of CPU threads to use when reading to pandas.DataFrame.
94-
95-
.. versionadded:: 0.21.0
96-
.. deprecated:: 0.24.0
9790
use_threads : bool, default True
9891
Whether to parallelize reading using multiple threads.
9992

pandas/tests/io/test_feather.py

-17
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,6 @@ def test_unsupported_other(self):
107107
# Some versions raise ValueError, others raise ArrowInvalid.
108108
self.check_error_on_write(df, Exception)
109109

110-
def test_rw_nthreads(self):
111-
df = pd.DataFrame({"A": np.arange(100000)})
112-
expected_warning = (
113-
"the 'nthreads' keyword is deprecated, use 'use_threads' instead"
114-
)
115-
# TODO: make the warning work with check_stacklevel=True
116-
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False) as w:
117-
self.check_round_trip(df, nthreads=2)
118-
# we have an extra FutureWarning because of #GH23752
119-
assert any(expected_warning in str(x) for x in w)
120-
121-
# TODO: make the warning work with check_stacklevel=True
122-
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False) as w:
123-
self.check_round_trip(df, nthreads=1)
124-
# we have an extra FutureWarnings because of #GH23752
125-
assert any(expected_warning in str(x) for x in w)
126-
127110
def test_rw_use_threads(self):
128111
df = pd.DataFrame({"A": np.arange(100000)})
129112
self.check_round_trip(df, use_threads=True)

0 commit comments

Comments
 (0)