diff --git a/doc/source/whatsnew/v3.0.0.rst b/doc/source/whatsnew/v3.0.0.rst index 278971ef88a0f..eb078e1f18f7a 100644 --- a/doc/source/whatsnew/v3.0.0.rst +++ b/doc/source/whatsnew/v3.0.0.rst @@ -254,6 +254,7 @@ Removal of prior version deprecations/changes - Enforced deprecation of :meth:`offsets.Tick.delta`, use ``pd.Timedelta(obj)`` instead (:issue:`55498`) - Enforced deprecation of ``axis=None`` acting the same as ``axis=0`` in the DataFrame reductions ``sum``, ``prod``, ``std``, ``var``, and ``sem``, passing ``axis=None`` will now reduce over both axes; this is particularly the case when doing e.g. ``numpy.sum(df)`` (:issue:`21597`) - Enforced deprecation of ``core.internals`` members ``Block``, ``ExtensionBlock``, and ``DatetimeTZBlock`` (:issue:`58467`) +- Enforced deprecation of ``quantile`` keyword in :meth:`.Rolling.quantile` and :meth:`.Expanding.quantile`, renamed to ``q`` instead. (:issue:`52550`) - Enforced deprecation of non-standard (``np.ndarray``, :class:`ExtensionArray`, :class:`Index`, or :class:`Series`) argument to :func:`api.extensions.take` (:issue:`52981`) - Enforced deprecation of parsing system timezone strings to ``tzlocal``, which depended on system timezone, pass the 'tz' keyword instead (:issue:`50791`) - Enforced deprecation of passing a dictionary to :meth:`SeriesGroupBy.agg` (:issue:`52268`) diff --git a/pandas/core/window/expanding.py b/pandas/core/window/expanding.py index abe853a8aa259..f14954cd9a4b0 100644 --- a/pandas/core/window/expanding.py +++ b/pandas/core/window/expanding.py @@ -8,10 +8,7 @@ Literal, ) -from pandas.util._decorators import ( - deprecate_kwarg, - doc, -) +from pandas.util._decorators import doc from pandas.core.indexers.objects import ( BaseIndexer, @@ -709,7 +706,6 @@ def kurt(self, numeric_only: bool = False): aggregation_description="quantile", agg_method="quantile", ) - @deprecate_kwarg(old_arg_name="quantile", new_arg_name="q") def quantile( self, q: float, diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index db6078ae636e3..2243d8dd1a613 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -27,10 +27,7 @@ import pandas._libs.window.aggregations as window_aggregations from pandas.compat._optional import import_optional_dependency from pandas.errors import DataError -from pandas.util._decorators import ( - deprecate_kwarg, - doc, -) +from pandas.util._decorators import doc from pandas.core.dtypes.common import ( ensure_float64, @@ -2556,7 +2553,6 @@ def kurt(self, numeric_only: bool = False): aggregation_description="quantile", agg_method="quantile", ) - @deprecate_kwarg(old_arg_name="quantile", new_arg_name="q") def quantile( self, q: float, diff --git a/pandas/tests/window/test_expanding.py b/pandas/tests/window/test_expanding.py index 1c7bcb8493bc1..b4a045cd26fe4 100644 --- a/pandas/tests/window/test_expanding.py +++ b/pandas/tests/window/test_expanding.py @@ -691,12 +691,3 @@ def test_numeric_only_corr_cov_series(kernel, use_arg, numeric_only, dtype): op2 = getattr(expanding2, kernel) expected = op2(*arg2, numeric_only=numeric_only) tm.assert_series_equal(result, expected) - - -def test_keyword_quantile_deprecated(): - # GH #52550 - ser = Series([1, 2, 3, 4]) - with tm.assert_produces_warning( - FutureWarning, match="the 'quantile' keyword is deprecated, use 'q' instead" - ): - ser.expanding().quantile(quantile=0.5) diff --git a/pandas/tests/window/test_rolling_quantile.py b/pandas/tests/window/test_rolling_quantile.py index 1604d72d4f9b1..66713f1cfaa8d 100644 --- a/pandas/tests/window/test_rolling_quantile.py +++ b/pandas/tests/window/test_rolling_quantile.py @@ -173,12 +173,3 @@ def test_center_reindex_frame(frame, q): ) frame_rs = frame.rolling(window=25, center=True).quantile(q) tm.assert_frame_equal(frame_xp, frame_rs) - - -def test_keyword_quantile_deprecated(): - # GH #52550 - s = Series([1, 2, 3, 4]) - with tm.assert_produces_warning( - FutureWarning, match="the 'quantile' keyword is deprecated, use 'q' instead" - ): - s.rolling(2).quantile(quantile=0.4)