Skip to content

Commit

Permalink
DEPR: remove nthreads kwarg from read_feather (pandas-dev#29728)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored and proost committed Dec 19, 2019
1 parent f3e7952 commit feb517e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
- Removed previously deprecated :func:`pandas.tseries.plotting.tsplot` (:issue:`18627`)
- Removed the previously deprecated ``reduce`` and ``broadcast`` arguments from :meth:`DataFrame.apply` (:issue:`18577`)
- Removed the previously deprecated ``assert_raises_regex`` function in ``pandas.util.testing`` (:issue:`29174`)
- Removed previously deprecated "nthreads" argument from :func:`read_feather`, use "use_threads" instead (:issue:`23053`)
- Removed :meth:`Index.is_lexsorted_for_tuple` (:issue:`29305`)
- Removed support for nexted renaming in :meth:`DataFrame.aggregate`, :meth:`Series.aggregate`, :meth:`DataFrameGroupBy.aggregate`, :meth:`SeriesGroupBy.aggregate`, :meth:`Rolling.aggregate` (:issue:`29608`)
- Removed previously deprecated "order" argument from :func:`factorize` (:issue:`19751`)
Expand Down
7 changes: 0 additions & 7 deletions pandas/io/feather_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from distutils.version import LooseVersion

from pandas.compat._optional import import_optional_dependency
from pandas.util._decorators import deprecate_kwarg

from pandas import DataFrame, Int64Index, RangeIndex

Expand Down Expand Up @@ -66,7 +65,6 @@ def to_feather(df: DataFrame, path):
feather.write_feather(df, path)


@deprecate_kwarg(old_arg_name="nthreads", new_arg_name="use_threads")
def read_feather(path, columns=None, use_threads=True):
"""
Load a feather-format object from the file path.
Expand All @@ -89,11 +87,6 @@ def read_feather(path, columns=None, use_threads=True):
If not provided, all columns are read.
.. versionadded:: 0.24.0
nthreads : int, default 1
Number of CPU threads to use when reading to pandas.DataFrame.
.. versionadded:: 0.21.0
.. deprecated:: 0.24.0
use_threads : bool, default True
Whether to parallelize reading using multiple threads.
Expand Down
17 changes: 0 additions & 17 deletions pandas/tests/io/test_feather.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,6 @@ def test_unsupported_other(self):
# Some versions raise ValueError, others raise ArrowInvalid.
self.check_error_on_write(df, Exception)

def test_rw_nthreads(self):
df = pd.DataFrame({"A": np.arange(100000)})
expected_warning = (
"the 'nthreads' keyword is deprecated, use 'use_threads' instead"
)
# TODO: make the warning work with check_stacklevel=True
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False) as w:
self.check_round_trip(df, nthreads=2)
# we have an extra FutureWarning because of #GH23752
assert any(expected_warning in str(x) for x in w)

# TODO: make the warning work with check_stacklevel=True
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False) as w:
self.check_round_trip(df, nthreads=1)
# we have an extra FutureWarnings because of #GH23752
assert any(expected_warning in str(x) for x in w)

def test_rw_use_threads(self):
df = pd.DataFrame({"A": np.arange(100000)})
self.check_round_trip(df, use_threads=True)
Expand Down

0 comments on commit feb517e

Please sign in to comment.