Skip to content

Commit 1f597d3

Browse files
authored
Remove deprecated arguments and functions (#307)
# Conflicts: # pandas-stubs/core/frame.pyi # pandas-stubs/core/generic.pyi # pandas-stubs/core/groupby/groupby.pyi # pandas-stubs/core/indexes/datetimes.pyi # pandas-stubs/core/indexes/timedeltas.pyi # pandas-stubs/core/resample.pyi # pandas-stubs/core/series.pyi # pandas-stubs/core/window/rolling.pyi # pandas-stubs/io/formats/style.pyi # pandas-stubs/io/parsers.pyi # tests/test_pandas.py
1 parent e29f129 commit 1f597d3

18 files changed

+19
-39
lines changed

pandas-stubs/core/arrays/categorical.pyi

-6
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,6 @@ class Categorical(ExtensionArray, PandasObject):
194194
def describe(self): ...
195195
def repeat(self, repeats, axis=...): ...
196196
def isin(self, values): ...
197-
@overload
198-
def replace(self, to_replace, value, inplace: Literal[True]) -> None: ...
199-
@overload
200-
def replace(self, to_replace, value, inplace: Literal[False]) -> Categorical: ...
201-
@overload
202-
def replace(self, to_replace, value, inplace: bool = ...) -> Categorical | None: ...
203197

204198
class CategoricalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin):
205199
def __init__(self, data) -> None: ...

pandas-stubs/core/arrays/sparse/array.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin):
1010
self,
1111
data,
1212
sparse_index=...,
13-
index=...,
1413
fill_value=...,
1514
kind: str = ...,
1615
dtype=...,

pandas-stubs/core/frame.pyi

+1-3
Original file line numberDiff line numberDiff line change
@@ -1330,8 +1330,6 @@ class DataFrame(NDFrame, OpsMixin):
13301330
self,
13311331
start_time: _str | datetime.time,
13321332
end_time: _str | datetime.time,
1333-
include_start: _bool = ...,
1334-
include_end: _bool = ...,
13351333
axis: AxisType | None = ...,
13361334
) -> DataFrame: ...
13371335
@overload
@@ -1666,7 +1664,7 @@ class DataFrame(NDFrame, OpsMixin):
16661664
self,
16671665
axis: AxisType = ...,
16681666
method: Literal["average", "min", "max", "first", "dense"] = ...,
1669-
numeric_only: _bool | None = ...,
1667+
numeric_only: _bool = ...,
16701668
na_option: Literal["keep", "top", "bottom"] = ...,
16711669
ascending: _bool = ...,
16721670
pct: _bool = ...,

pandas-stubs/core/generic.pyi

+1-3
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,6 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
425425
self,
426426
start_time,
427427
end_time,
428-
include_start: _bool = ...,
429-
include_end: _bool = ...,
430428
axis=...,
431429
) -> NDFrame: ...
432430
def first(self, offset) -> NDFrame: ...
@@ -435,7 +433,7 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
435433
self,
436434
axis=...,
437435
method: Literal["average", "min", "max", "first", "dense"] = ...,
438-
numeric_only: _bool | None = ...,
436+
numeric_only: _bool = ...,
439437
na_option: Literal["keep", "top", "bottom"] = ...,
440438
ascending: _bool = ...,
441439
pct: _bool = ...,

pandas-stubs/core/groupby/groupby.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ class GroupBy(BaseGroupBy[NDFrameT]):
7979
def resample(self, rule, *args, **kwargs): ...
8080
def rolling(self, *args, **kwargs): ...
8181
def expanding(self, *args, **kwargs): ...
82-
def pad(self, limit: int | None = ...): ...
8382
def ffill(self, limit: int | None = ...) -> DataFrame | Series: ...
84-
def backfill(self, limit: int | None = ...) -> DataFrame | Series: ...
8583
def bfill(self, limit: int | None = ...) -> DataFrame | Series: ...
8684
def nth(
8785
self, n: int | list[int], dropna: str | None = ...

pandas-stubs/core/indexes/base.pyi

+4-4
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class Index(IndexOpsMixin, PandasObject):
156156
def symmetric_difference(
157157
self, other: list[T1] | Index, result_name=..., sort=...
158158
) -> Index: ...
159-
def get_loc(self, key, method=..., tolerance=...): ...
159+
def get_loc(self, key, tolerance=...): ...
160160
def get_indexer(self, target, method=..., limit=..., tolerance=...): ...
161161
def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ...
162162
def join(
@@ -198,9 +198,9 @@ class Index(IndexOpsMixin, PandasObject):
198198
def groupby(self, values) -> dict[Hashable, np.ndarray]: ...
199199
def map(self, mapper, na_action=...) -> Index: ...
200200
def isin(self, values, level=...) -> np_ndarray_bool: ...
201-
def slice_indexer(self, start=..., end=..., step=..., kind=...): ...
202-
def get_slice_bound(self, label, side, kind=...): ...
203-
def slice_locs(self, start=..., end=..., step=..., kind=...): ...
201+
def slice_indexer(self, start=..., end=..., step=...): ...
202+
def get_slice_bound(self, label, side): ...
203+
def slice_locs(self, start=..., end=..., step=...): ...
204204
def delete(self, loc): ...
205205
def insert(self, loc, item): ...
206206
def drop(self, labels, *, errors: _str = ...) -> Index: ...

pandas-stubs/core/indexes/category.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CategoricalIndex(ExtensionIndex, accessor.PandasDelegate):
3333
def is_monotonic_decreasing(self) -> bool: ...
3434
def unique(self, level=...): ...
3535
def duplicated(self, keep: str = ...): ...
36-
def get_loc(self, key, method=...): ...
36+
def get_loc(self, key): ...
3737
def get_value(self, seriesArrayLike, key): ...
3838
def where(self, cond, other=...): ...
3939
def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ...

pandas-stubs/core/indexes/datetimes.pyi

+2-3
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,13 @@ class DatetimeIndex(DatetimeTimedeltaMixin, DatetimeIndexProperties):
5858
def __sub__(self, other: Timedelta | TimedeltaIndex) -> DatetimeIndex: ...
5959
@overload
6060
def __sub__(self, other: Timestamp | DatetimeIndex) -> TimedeltaIndex: ...
61-
def union_many(self, others): ...
6261
# overload needed because Index.to_series() and DatetimeIndex.to_series() have
6362
# different arguments
6463
def to_series(self, keep_tz=..., index=..., name=...) -> TimestampSeries: ... # type: ignore[override]
6564
def snap(self, freq: str = ...): ...
6665
def get_value(self, series, key): ...
67-
def get_loc(self, key, method=..., tolerance=...): ...
68-
def slice_indexer(self, start=..., end=..., step=..., kind=...): ...
66+
def get_loc(self, key, tolerance=...): ...
67+
def slice_indexer(self, start=..., end=..., step=...): ...
6968
def searchsorted(self, value, side: str = ..., sorter=...): ...
7069
def is_type_compatible(self, typ) -> bool: ...
7170
@property

pandas-stubs/core/indexes/interval.pyi

+1-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ class IntervalIndex(IntervalMixin, ExtensionIndex):
5959
def memory_usage(self, deep: bool = ...) -> int: ...
6060
@property
6161
def is_overlapping(self) -> bool: ...
62-
def get_loc(
63-
self, key, method: str | None = ..., tolerance=...
64-
) -> int | slice | np.ndarray: ...
62+
def get_loc(self, key, tolerance=...) -> int | slice | np.ndarray: ...
6563
def get_indexer(
6664
self,
6765
targetArrayLike,

pandas-stubs/core/indexes/multi.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ class MultiIndex(Index):
118118
def get_indexer_non_unique(self, target): ...
119119
def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ...
120120
def get_slice_bound(
121-
self, label: Hashable | Sequence[Hashable], side: str, kind: str = ...
121+
self, label: Hashable | Sequence[Hashable], side: str
122122
) -> int: ...
123-
def slice_locs(self, start=..., end=..., step=..., kind=...): ...
124-
def get_loc(self, key, method=...): ...
123+
def slice_locs(self, start=..., end=..., step=...): ...
124+
def get_loc(self, key): ...
125125
def get_loc_level(self, key, level=..., drop_level: bool = ...): ...
126126
def get_locs(self, seq): ...
127127
def truncate(self, before=..., after=...): ...

pandas-stubs/core/indexes/numeric.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ class Float64Index(NumericIndex):
3737
def get_value(self, series, key): ...
3838
def equals(self, other) -> bool: ...
3939
def __contains__(self, other) -> bool: ...
40-
def get_loc(self, key, method=..., tolerance=...): ...
40+
def get_loc(self, key, tolerance=...): ...
4141
def is_unique(self) -> bool: ...
4242
def isin(self, values, level=...): ...

pandas-stubs/core/indexes/period.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PeriodIndex(DatetimeIndexOpsMixin, Int64Index):
3131
def get_value(self, series, key): ...
3232
def get_indexer(self, target, method=..., limit=..., tolerance=...): ...
3333
def get_indexer_non_unique(self, target): ...
34-
def get_loc(self, key, method=..., tolerance=...): ...
34+
def get_loc(self, key, tolerance=...): ...
3535
def insert(self, loc, item): ...
3636
def join(
3737
self,

pandas-stubs/core/indexes/range.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class RangeIndex(Int64Index):
3737
@property
3838
def has_duplicates(self) -> bool: ...
3939
def __contains__(self, key: int | np.integer) -> bool: ...
40-
def get_loc(self, key, method=..., tolerance=...): ...
40+
def get_loc(self, key, tolerance=...): ...
4141
def get_indexer(self, target, method=..., limit=..., tolerance=...): ...
4242
def tolist(self): ...
4343
def copy(self, name=..., deep: bool = ..., dtype=..., **kwargs): ...

pandas-stubs/core/indexes/timedeltas.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TimedeltaIndex(DatetimeTimedeltaMixin, TimedeltaIndexProperties):
3434
def __truediv__(self, other: num) -> TimedeltaIndex: ... # type: ignore[override]
3535
def astype(self, dtype, copy: bool = ...): ...
3636
def get_value(self, series, key): ...
37-
def get_loc(self, key, method=..., tolerance=...): ...
37+
def get_loc(self, key, tolerance=...): ...
3838
def searchsorted(self, value, side: str = ..., sorter=...): ...
3939
def is_type_compatible(self, typ) -> bool: ...
4040
@property

pandas-stubs/core/series.pyi

+1-3
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,6 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
10561056
self,
10571057
start_time: _str | time,
10581058
end_time: _str | time,
1059-
include_start: _bool = ...,
1060-
include_end: _bool = ...,
10611059
axis: SeriesAxisType | None = ...,
10621060
) -> Series[S1]: ...
10631061
def resample(
@@ -1082,7 +1080,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
10821080
self,
10831081
axis: SeriesAxisType = ...,
10841082
method: Literal["average", "min", "max", "first", "dense"] = ...,
1085-
numeric_only: _bool | None = ...,
1083+
numeric_only: _bool = ...,
10861084
na_option: Literal["keep", "top", "bottom"] = ...,
10871085
ascending: _bool = ...,
10881086
pct: _bool = ...,

pandas-stubs/core/window/rolling.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class _Window(PandasObject, SelectionMixin):
4242
def is_datetimelike(self) -> bool | None: ...
4343
@property
4444
def is_freq_type(self) -> bool: ...
45-
def validate(self) -> None: ...
4645
def __getattr__(self, attr: str): ...
4746
def __iter__(self): ...
4847
def aggregate(
@@ -53,7 +52,6 @@ class _Window(PandasObject, SelectionMixin):
5352
) -> Scalar | DataFrame | Series: ...
5453

5554
class Window(_Window):
56-
def validate(self) -> None: ...
5755
def sum(self, *args, **kwargs): ...
5856
def mean(self, *args, **kwargs): ...
5957
def var(self, ddof: int = ..., *args, **kwargs): ...
@@ -104,7 +102,6 @@ class Rolling(_Rolling_and_Expanding):
104102
window = ...
105103
win_type: str = ...
106104
min_periods: int = ...
107-
def validate(self) -> None: ...
108105
def count(self) -> DataFrame | Series: ...
109106
def apply(
110107
self,

pandas-stubs/io/parsers.pyi

Whitespace-only changes.

pandas-stubs/io/xml.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ from pandas._typing import (
1515

1616
def read_xml(
1717
path_or_buffer: FilePath | ReadBuffer[bytes] | ReadBuffer[str],
18+
*,
1819
xpath: str = ...,
1920
namespaces: dict[str, str] | None = ...,
2021
elems_only: bool = ...,

0 commit comments

Comments
 (0)