Skip to content

Commit bf7960d

Browse files
authored
DEPR: 1.x deprecation cleanups (#50385)
* DEPR: 1.x deprecation cleanups * Remove more
1 parent 4e4be0b commit bf7960d

File tree

5 files changed

+6
-24
lines changed

5 files changed

+6
-24
lines changed

pandas/core/arrays/sparse/array.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,6 @@ class SparseArray(OpsMixin, PandasObject, ExtensionArray):
299299
A dense array of values to store in the SparseArray. This may contain
300300
`fill_value`.
301301
sparse_index : SparseIndex, optional
302-
index : Index
303-
304-
.. deprecated:: 1.4.0
305-
Use a function like `np.full` to construct an array with the desired
306-
repeats of the scalar value instead.
307-
308302
fill_value : scalar, optional
309303
Elements in data that are ``fill_value`` are not stored in the
310304
SparseArray. For memory savings, this should be the most common value

pandas/core/generic.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,9 +1758,6 @@ def _get_label_or_level_values(self, key: Level, axis: AxisInt = 0) -> ArrayLike
17581758
if `key` matches neither a label nor a level
17591759
ValueError
17601760
if `key` matches multiple labels
1761-
FutureWarning
1762-
if `key` is ambiguous. This will become an ambiguity error in a
1763-
future version
17641761
"""
17651762
axis = self._get_axis_number(axis)
17661763
other_axes = [ax for ax in range(self._AXIS_LEN) if ax != axis]
@@ -6035,11 +6032,11 @@ def astype(
60356032
60366033
Notes
60376034
-----
6038-
.. deprecated:: 1.3.0
6035+
.. versionchanged:: 2.0.0
60396036
60406037
Using ``astype`` to convert from timezone-naive dtype to
6041-
timezone-aware dtype is deprecated and will raise in a
6042-
future version. Use :meth:`Series.dt.tz_localize` instead.
6038+
timezone-aware dtype will raise an exception.
6039+
Use :meth:`Series.dt.tz_localize` instead.
60436040
60446041
Examples
60456042
--------

pandas/core/indexes/interval.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -612,19 +612,13 @@ def _searchsorted_monotonic(self, label, side: Literal["left", "right"] = "left"
612612
# --------------------------------------------------------------------
613613
# Indexing Methods
614614

615-
def get_loc(
616-
self, key, method: str | None = None, tolerance=None
617-
) -> int | slice | np.ndarray:
615+
def get_loc(self, key) -> int | slice | np.ndarray:
618616
"""
619617
Get integer location, slice or boolean mask for requested label.
620618
621619
Parameters
622620
----------
623621
key : label
624-
method : {None}, optional
625-
* default: matches where the label is within an interval only.
626-
627-
.. deprecated:: 1.4
628622
629623
Returns
630624
-------
@@ -655,7 +649,6 @@ def get_loc(
655649
>>> index.get_loc(pd.Interval(0, 1))
656650
0
657651
"""
658-
self._check_indexing_method(method)
659652
self._check_indexing_error(key)
660653

661654
if isinstance(key, Interval):

pandas/core/indexing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,8 +2043,6 @@ def _setitem_single_block(self, indexer, value, name: str) -> None:
20432043
if len(item_labels.get_indexer_for([col])) == 1:
20442044
# e.g. test_loc_setitem_empty_append_expands_rows
20452045
loc = item_labels.get_loc(col)
2046-
# Go through _setitem_single_column to get
2047-
# FutureWarning if relevant.
20482046
self._setitem_single_column(loc, value, indexer[0])
20492047
return
20502048

pandas/core/tools/timedeltas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ def to_timedelta(
9797
arg : str, timedelta, list-like or Series
9898
The data to be converted to timedelta.
9999
100-
.. deprecated:: 1.2
100+
.. versionchanged:: 2.0
101101
Strings with units 'M', 'Y' and 'y' do not represent
102-
unambiguous timedelta values and will be removed in a future version
102+
unambiguous timedelta values and will raise an exception.
103103
104104
unit : str, optional
105105
Denotes the unit of the arg for numeric `arg`. Defaults to ``"ns"``.

0 commit comments

Comments
 (0)