From 1fa7cc2be1238d77268705c55c0ef7720e236ca3 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Wed, 20 Nov 2019 09:07:18 -0800 Subject: [PATCH] DEPR: remove nthreads kwarg from read_feather (#29728) --- doc/source/whatsnew/v1.0.0.rst | 1 + pandas/io/feather_format.py | 7 ------- pandas/tests/io/test_feather.py | 17 ----------------- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index a3d17b2b32353..c3ff0e83938fa 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -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`) diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index d9e88f42c2ef2..dffe04fb63720 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -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 @@ -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. @@ -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. diff --git a/pandas/tests/io/test_feather.py b/pandas/tests/io/test_feather.py index 0f68a6534dad1..e06f2c31a2870 100644 --- a/pandas/tests/io/test_feather.py +++ b/pandas/tests/io/test_feather.py @@ -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)