Skip to content

Commit a22073c

Browse files
authored
CLN: Enforce rolling/expanding.quantile(quantile=) keyword (#58605)
1 parent 1642fcb commit a22073c

File tree

5 files changed

+3
-28
lines changed

5 files changed

+3
-28
lines changed

doc/source/whatsnew/v3.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ Removal of prior version deprecations/changes
254254
- Enforced deprecation of :meth:`offsets.Tick.delta`, use ``pd.Timedelta(obj)`` instead (:issue:`55498`)
255255
- 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`)
256256
- Enforced deprecation of ``core.internals`` members ``Block``, ``ExtensionBlock``, and ``DatetimeTZBlock`` (:issue:`58467`)
257+
- Enforced deprecation of ``quantile`` keyword in :meth:`.Rolling.quantile` and :meth:`.Expanding.quantile`, renamed to ``q`` instead. (:issue:`52550`)
257258
- Enforced deprecation of non-standard (``np.ndarray``, :class:`ExtensionArray`, :class:`Index`, or :class:`Series`) argument to :func:`api.extensions.take` (:issue:`52981`)
258259
- Enforced deprecation of parsing system timezone strings to ``tzlocal``, which depended on system timezone, pass the 'tz' keyword instead (:issue:`50791`)
259260
- Enforced deprecation of passing a dictionary to :meth:`SeriesGroupBy.agg` (:issue:`52268`)

pandas/core/window/expanding.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
Literal,
99
)
1010

11-
from pandas.util._decorators import (
12-
deprecate_kwarg,
13-
doc,
14-
)
11+
from pandas.util._decorators import doc
1512

1613
from pandas.core.indexers.objects import (
1714
BaseIndexer,
@@ -709,7 +706,6 @@ def kurt(self, numeric_only: bool = False):
709706
aggregation_description="quantile",
710707
agg_method="quantile",
711708
)
712-
@deprecate_kwarg(old_arg_name="quantile", new_arg_name="q")
713709
def quantile(
714710
self,
715711
q: float,

pandas/core/window/rolling.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727
import pandas._libs.window.aggregations as window_aggregations
2828
from pandas.compat._optional import import_optional_dependency
2929
from pandas.errors import DataError
30-
from pandas.util._decorators import (
31-
deprecate_kwarg,
32-
doc,
33-
)
30+
from pandas.util._decorators import doc
3431

3532
from pandas.core.dtypes.common import (
3633
ensure_float64,
@@ -2556,7 +2553,6 @@ def kurt(self, numeric_only: bool = False):
25562553
aggregation_description="quantile",
25572554
agg_method="quantile",
25582555
)
2559-
@deprecate_kwarg(old_arg_name="quantile", new_arg_name="q")
25602556
def quantile(
25612557
self,
25622558
q: float,

pandas/tests/window/test_expanding.py

-9
Original file line numberDiff line numberDiff line change
@@ -691,12 +691,3 @@ def test_numeric_only_corr_cov_series(kernel, use_arg, numeric_only, dtype):
691691
op2 = getattr(expanding2, kernel)
692692
expected = op2(*arg2, numeric_only=numeric_only)
693693
tm.assert_series_equal(result, expected)
694-
695-
696-
def test_keyword_quantile_deprecated():
697-
# GH #52550
698-
ser = Series([1, 2, 3, 4])
699-
with tm.assert_produces_warning(
700-
FutureWarning, match="the 'quantile' keyword is deprecated, use 'q' instead"
701-
):
702-
ser.expanding().quantile(quantile=0.5)

pandas/tests/window/test_rolling_quantile.py

-9
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,3 @@ def test_center_reindex_frame(frame, q):
173173
)
174174
frame_rs = frame.rolling(window=25, center=True).quantile(q)
175175
tm.assert_frame_equal(frame_xp, frame_rs)
176-
177-
178-
def test_keyword_quantile_deprecated():
179-
# GH #52550
180-
s = Series([1, 2, 3, 4])
181-
with tm.assert_produces_warning(
182-
FutureWarning, match="the 'quantile' keyword is deprecated, use 'q' instead"
183-
):
184-
s.rolling(2).quantile(quantile=0.4)

0 commit comments

Comments
 (0)