From 5de29d6ca8f67e323f29d1f06c0ac57ea81cbec9 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:54:47 -0800 Subject: [PATCH 1/2] Remove enforced .. deprecated sphinx refs --- doc/source/user_guide/timeseries.rst | 14 -------------- pandas/core/algorithms.py | 10 ++-------- pandas/core/generic.py | 4 ---- pandas/core/groupby/generic.py | 6 +----- pandas/core/groupby/groupby.py | 3 --- pandas/core/internals/managers.py | 1 + pandas/core/tools/timedeltas.py | 8 ++------ pandas/core/window/expanding.py | 2 -- pandas/core/window/rolling.py | 3 --- pandas/io/excel/_base.py | 3 --- pandas/io/html.py | 6 +----- pandas/io/json/_json.py | 3 --- pandas/io/xml.py | 6 +----- 13 files changed, 8 insertions(+), 61 deletions(-) diff --git a/doc/source/user_guide/timeseries.rst b/doc/source/user_guide/timeseries.rst index 9674cb383c1e9..d21feeb005a95 100644 --- a/doc/source/user_guide/timeseries.rst +++ b/doc/source/user_guide/timeseries.rst @@ -1294,15 +1294,6 @@ frequencies. We will refer to these aliases as *offset aliases*. "us", "microseconds" "ns", "nanoseconds" -.. deprecated:: 2.2.0 - - Aliases ``H``, ``BH``, ``CBH``, ``T``, ``S``, ``L``, ``U``, and ``N`` - are deprecated in favour of the aliases ``h``, ``bh``, ``cbh``, - ``min``, ``s``, ``ms``, ``us``, and ``ns``. - - Aliases ``Y``, ``M``, and ``Q`` are deprecated in favour of the aliases - ``YE``, ``ME``, ``QE``. - .. note:: @@ -1358,11 +1349,6 @@ frequencies. We will refer to these aliases as *period aliases*. "us", "microseconds" "ns", "nanoseconds" -.. deprecated:: 2.2.0 - - Aliases ``H``, ``T``, ``S``, ``L``, ``U``, and ``N`` are deprecated in favour of the aliases - ``h``, ``min``, ``s``, ``ms``, ``us``, and ``ns``. - Combining aliases ~~~~~~~~~~~~~~~~~ diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 4e0cc93e64458..c31a2cbb41dd3 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -1140,14 +1140,8 @@ def take( Parameters ---------- - arr : array-like or scalar value - Non array-likes (sequences/scalars without a dtype) are coerced - to an ndarray. - - .. deprecated:: 2.1.0 - Passing an argument other than a numpy.ndarray, ExtensionArray, - Index, or Series is deprecated. - + arr : numpy.ndarray, ExtensionArray, Index, or Series + Input array. indices : sequence of int or one-dimensional np.ndarray of int Indices to be taken. axis : int, default 0 diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 6d1ad777619ea..79f682988a148 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -10965,10 +10965,6 @@ def pct_change( Periods to shift for forming percent change. fill_method : None Must be None. This argument will be removed in a future version of pandas. - - .. deprecated:: 2.1 - All options of `fill_method` are deprecated except `fill_method=None`. - freq : DateOffset, timedelta, or str, optional Increment to use from time series API (e.g. 'ME' or BDay()). **kwargs diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index eb2ee11c39098..63d89982d77d4 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -375,7 +375,7 @@ def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs) Parameters ---------- - func : function, str, list, dict or None + func : function, str, list or None Function to use for aggregating the data. If a function, must either work when passed a Series or when passed to Series.apply. @@ -399,10 +399,6 @@ def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs) Each group's index will be passed to the user defined function and optionally available for use. - .. deprecated:: 2.1.0 - - Passing a dictionary is deprecated and will raise in a future version - of pandas. Pass a list of aggregations instead. *args Positional arguments to pass to func. engine : str, default None diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 326e4ffde815b..b4bdaefbe34b9 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -5366,9 +5366,6 @@ def pct_change( fill_method : None Must be None. This argument will be removed in a future version of pandas. - .. deprecated:: 2.1 - All options of `fill_method` are deprecated except `fill_method=None`. - freq : str, pandas offset object, or None, default None The frequency increment for time series data (e.g., 'M' for month-end). If None, the frequency is inferred from the index. Relevant for time diff --git a/pandas/core/internals/managers.py b/pandas/core/internals/managers.py index 5e2050cd19767..a6e42b40513c4 100644 --- a/pandas/core/internals/managers.py +++ b/pandas/core/internals/managers.py @@ -598,6 +598,7 @@ def setitem(self, indexer, value) -> Self: return self # No need to split if we either set all columns or on a single block # manager + self = self.copy(deep=True) return self.apply("setitem", indexer=indexer, value=value) diff --git a/pandas/core/tools/timedeltas.py b/pandas/core/tools/timedeltas.py index 2dc5e29308214..bbdbe363d07ee 100644 --- a/pandas/core/tools/timedeltas.py +++ b/pandas/core/tools/timedeltas.py @@ -113,19 +113,15 @@ def to_timedelta( * 'W' * 'D' / 'days' / 'day' - * 'hours' / 'hour' / 'hr' / 'h' / 'H' + * 'hours' / 'hour' / 'hr' / 'h' * 'm' / 'minute' / 'min' / 'minutes' - * 's' / 'seconds' / 'sec' / 'second' / 'S' + * 's' / 'seconds' / 'sec' / 'second' * 'ms' / 'milliseconds' / 'millisecond' / 'milli' / 'millis' * 'us' / 'microseconds' / 'microsecond' / 'micro' / 'micros' * 'ns' / 'nanoseconds' / 'nano' / 'nanos' / 'nanosecond' Must not be specified when `arg` contains strings and ``errors="raise"``. - .. deprecated:: 2.2.0 - Units 'H'and 'S' are deprecated and will be removed - in a future version. Please use 'h' and 's'. - errors : {'raise', 'coerce'}, default 'raise' - If 'raise', then invalid parsing will raise an exception. - If 'coerce', then invalid parsing will be set as NaT. diff --git a/pandas/core/window/expanding.py b/pandas/core/window/expanding.py index d0d9d5947be31..48650620f9143 100644 --- a/pandas/core/window/expanding.py +++ b/pandas/core/window/expanding.py @@ -1078,8 +1078,6 @@ def quantile( q : float Quantile to compute. 0 <= quantile <= 1. - .. deprecated:: 2.1.0 - This was renamed from 'quantile' to 'q' in version 2.1.0. interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'} This optional parameter specifies the interpolation method to use, when the desired quantile lies between two data points `i` and `j`: diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 6c53554084afb..17182816c7d7a 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -3088,9 +3088,6 @@ def quantile( q : float Quantile to compute. 0 <= quantile <= 1. - .. deprecated:: 2.1.0 - This was renamed from 'quantile' to 'q' in version 2.1.0. - interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'} This optional parameter specifies the interpolation method to use, when the desired quantile lies between two data points `i` and `j`: diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index fcd5b05465fe9..90149015b4051 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -214,9 +214,6 @@ def read_excel( such as a file handle (e.g. via builtin ``open`` function) or ``StringIO``. - .. deprecated:: 2.1.0 - Passing byte strings is deprecated. To read from a - byte string, wrap it in a ``BytesIO`` object. sheet_name : str, int, list, or None, default 0 Strings are used for sheet names. Integers are used in zero-indexed sheet positions (chart sheets do not count as a sheet position). diff --git a/pandas/io/html.py b/pandas/io/html.py index 03b10d6ead805..d3a37ac526a41 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -1052,16 +1052,12 @@ def read_html( Parameters ---------- io : str, path object, or file-like object - String, path object (implementing ``os.PathLike[str]``), or file-like + String path, path object (implementing ``os.PathLike[str]``), or file-like object implementing a string ``read()`` function. The string can represent a URL. Note that lxml only accepts the http, ftp and file url protocols. If you have a URL that starts with ``'https'`` you might try removing the ``'s'``. - .. deprecated:: 2.1.0 - Passing html literal strings is deprecated. - Wrap literal string/bytes input in ``io.StringIO``/``io.BytesIO`` instead. - match : str or compiled regular expression, optional The set of tables containing text matching this regex or string will be returned. Unless the HTML is extremely simple you will probably need to diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 2bd6efd359717..193189eb624ec 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -549,9 +549,6 @@ def read_json( such as a file handle (e.g. via builtin ``open`` function) or ``StringIO``. - .. deprecated:: 2.1.0 - Passing json literal strings is deprecated. - orient : str, optional Indication of expected JSON string format. Compatible JSON strings can be produced by ``to_json()`` with a diff --git a/pandas/io/xml.py b/pandas/io/xml.py index 196e4ccd84bca..17ca6f1988968 100644 --- a/pandas/io/xml.py +++ b/pandas/io/xml.py @@ -853,15 +853,11 @@ def read_xml( Parameters ---------- path_or_buffer : str, path object, or file-like object - String, path object (implementing ``os.PathLike[str]``), or file-like + String path, path object (implementing ``os.PathLike[str]``), or file-like object implementing a ``read()`` function. The string can be a path. The string can further be a URL. Valid URL schemes include http, ftp, s3, and file. - .. deprecated:: 2.1.0 - Passing xml literal strings is deprecated. - Wrap literal xml input in ``io.StringIO`` or ``io.BytesIO`` instead. - xpath : str, optional, default './\*' The ``XPath`` to parse required set of nodes for migration to :class:`~pandas.DataFrame`.``XPath`` should return a collection of elements From 83cd16a91a0599ae54ec16381c629a8929c31623 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 10 Dec 2025 11:55:22 -0800 Subject: [PATCH 2/2] Undo newline --- pandas/core/internals/managers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/core/internals/managers.py b/pandas/core/internals/managers.py index a6e42b40513c4..5e2050cd19767 100644 --- a/pandas/core/internals/managers.py +++ b/pandas/core/internals/managers.py @@ -598,7 +598,6 @@ def setitem(self, indexer, value) -> Self: return self # No need to split if we either set all columns or on a single block # manager - self = self.copy(deep=True) return self.apply("setitem", indexer=indexer, value=value)