Skip to content

Remove deprecated arguments and functions #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pandas-stubs/core/arrays/categorical.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@ class Categorical(ExtensionArray, PandasObject):
def describe(self): ...
def repeat(self, repeats, axis=...): ...
def isin(self, values): ...
@overload
def replace(self, to_replace, value, inplace: Literal[True]) -> None: ...
@overload
def replace(self, to_replace, value, inplace: Literal[False]) -> Categorical: ...
@overload
def replace(self, to_replace, value, inplace: bool = ...) -> Categorical | None: ...

class CategoricalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin):
def __init__(self, data) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion pandas-stubs/core/arrays/sparse/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin):
self,
data,
sparse_index=...,
index=...,
fill_value=...,
kind: str = ...,
dtype=...,
Expand Down
4 changes: 1 addition & 3 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1330,8 +1330,6 @@ class DataFrame(NDFrame, OpsMixin):
self,
start_time: _str | datetime.time,
end_time: _str | datetime.time,
include_start: _bool = ...,
include_end: _bool = ...,
axis: AxisType | None = ...,
) -> DataFrame: ...
@overload
Expand Down Expand Up @@ -1666,7 +1664,7 @@ class DataFrame(NDFrame, OpsMixin):
self,
axis: AxisType = ...,
method: Literal["average", "min", "max", "first", "dense"] = ...,
numeric_only: _bool | None = ...,
numeric_only: _bool = ...,
na_option: Literal["keep", "top", "bottom"] = ...,
ascending: _bool = ...,
pct: _bool = ...,
Expand Down
4 changes: 1 addition & 3 deletions pandas-stubs/core/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,6 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
self,
start_time,
end_time,
include_start: _bool = ...,
include_end: _bool = ...,
axis=...,
) -> NDFrame: ...
def first(self, offset) -> NDFrame: ...
Expand All @@ -435,7 +433,7 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
self,
axis=...,
method: Literal["average", "min", "max", "first", "dense"] = ...,
numeric_only: _bool | None = ...,
numeric_only: _bool = ...,
na_option: Literal["keep", "top", "bottom"] = ...,
ascending: _bool = ...,
pct: _bool = ...,
Expand Down
2 changes: 0 additions & 2 deletions pandas-stubs/core/groupby/groupby.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ class GroupBy(BaseGroupBy[NDFrameT]):
def resample(self, rule, *args, **kwargs): ...
def rolling(self, *args, **kwargs): ...
def expanding(self, *args, **kwargs): ...
def pad(self, limit: int | None = ...): ...
def ffill(self, limit: int | None = ...) -> DataFrame | Series: ...
def backfill(self, limit: int | None = ...) -> DataFrame | Series: ...
def bfill(self, limit: int | None = ...) -> DataFrame | Series: ...
def nth(
self, n: int | list[int], dropna: str | None = ...
Expand Down
8 changes: 4 additions & 4 deletions pandas-stubs/core/indexes/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Index(IndexOpsMixin, PandasObject):
def symmetric_difference(
self, other: list[T1] | Index, result_name=..., sort=...
) -> Index: ...
def get_loc(self, key, method=..., tolerance=...): ...
def get_loc(self, key, tolerance=...): ...
def get_indexer(self, target, method=..., limit=..., tolerance=...): ...
def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ...
def join(
Expand Down Expand Up @@ -198,9 +198,9 @@ class Index(IndexOpsMixin, PandasObject):
def groupby(self, values) -> dict[Hashable, np.ndarray]: ...
def map(self, mapper, na_action=...) -> Index: ...
def isin(self, values, level=...) -> np_ndarray_bool: ...
def slice_indexer(self, start=..., end=..., step=..., kind=...): ...
def get_slice_bound(self, label, side, kind=...): ...
def slice_locs(self, start=..., end=..., step=..., kind=...): ...
def slice_indexer(self, start=..., end=..., step=...): ...
def get_slice_bound(self, label, side): ...
def slice_locs(self, start=..., end=..., step=...): ...
def delete(self, loc): ...
def insert(self, loc, item): ...
def drop(self, labels, *, errors: _str = ...) -> Index: ...
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/category.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CategoricalIndex(ExtensionIndex, accessor.PandasDelegate):
def is_monotonic_decreasing(self) -> bool: ...
def unique(self, level=...): ...
def duplicated(self, keep: str = ...): ...
def get_loc(self, key, method=...): ...
def get_loc(self, key): ...
def get_value(self, seriesArrayLike, key): ...
def where(self, cond, other=...): ...
def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ...
Expand Down
5 changes: 2 additions & 3 deletions pandas-stubs/core/indexes/datetimes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,13 @@ class DatetimeIndex(DatetimeTimedeltaMixin, DatetimeIndexProperties):
def __sub__(self, other: Timedelta | TimedeltaIndex) -> DatetimeIndex: ...
@overload
def __sub__(self, other: Timestamp | DatetimeIndex) -> TimedeltaIndex: ...
def union_many(self, others): ...
# overload needed because Index.to_series() and DatetimeIndex.to_series() have
# different arguments
def to_series(self, keep_tz=..., index=..., name=...) -> TimestampSeries: ... # type: ignore[override]
def snap(self, freq: str = ...): ...
def get_value(self, series, key): ...
def get_loc(self, key, method=..., tolerance=...): ...
def slice_indexer(self, start=..., end=..., step=..., kind=...): ...
def get_loc(self, key, tolerance=...): ...
def slice_indexer(self, start=..., end=..., step=...): ...
def searchsorted(self, value, side: str = ..., sorter=...): ...
def is_type_compatible(self, typ) -> bool: ...
@property
Expand Down
4 changes: 1 addition & 3 deletions pandas-stubs/core/indexes/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ class IntervalIndex(IntervalMixin, ExtensionIndex):
def memory_usage(self, deep: bool = ...) -> int: ...
@property
def is_overlapping(self) -> bool: ...
def get_loc(
self, key, method: str | None = ..., tolerance=...
) -> int | slice | np.ndarray: ...
def get_loc(self, key, tolerance=...) -> int | slice | np.ndarray: ...
def get_indexer(
self,
targetArrayLike,
Expand Down
6 changes: 3 additions & 3 deletions pandas-stubs/core/indexes/multi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ class MultiIndex(Index):
def get_indexer_non_unique(self, target): ...
def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ...
def get_slice_bound(
self, label: Hashable | Sequence[Hashable], side: str, kind: str = ...
self, label: Hashable | Sequence[Hashable], side: str
) -> int: ...
def slice_locs(self, start=..., end=..., step=..., kind=...): ...
def get_loc(self, key, method=...): ...
def slice_locs(self, start=..., end=..., step=...): ...
def get_loc(self, key): ...
def get_loc_level(self, key, level=..., drop_level: bool = ...): ...
def get_locs(self, seq): ...
def truncate(self, before=..., after=...): ...
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/numeric.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ class Float64Index(NumericIndex):
def get_value(self, series, key): ...
def equals(self, other) -> bool: ...
def __contains__(self, other) -> bool: ...
def get_loc(self, key, method=..., tolerance=...): ...
def get_loc(self, key, tolerance=...): ...
def is_unique(self) -> bool: ...
def isin(self, values, level=...): ...
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/period.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PeriodIndex(DatetimeIndexOpsMixin, Int64Index):
def get_value(self, series, key): ...
def get_indexer(self, target, method=..., limit=..., tolerance=...): ...
def get_indexer_non_unique(self, target): ...
def get_loc(self, key, method=..., tolerance=...): ...
def get_loc(self, key, tolerance=...): ...
def insert(self, loc, item): ...
def join(
self,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/range.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class RangeIndex(Int64Index):
@property
def has_duplicates(self) -> bool: ...
def __contains__(self, key: int | np.integer) -> bool: ...
def get_loc(self, key, method=..., tolerance=...): ...
def get_loc(self, key, tolerance=...): ...
def get_indexer(self, target, method=..., limit=..., tolerance=...): ...
def tolist(self): ...
def copy(self, name=..., deep: bool = ..., dtype=..., **kwargs): ...
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/timedeltas.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TimedeltaIndex(DatetimeTimedeltaMixin, TimelikeOps):
def __truediv__(self, other: num) -> TimedeltaIndex: ... # type: ignore[override]
def astype(self, dtype, copy: bool = ...): ...
def get_value(self, series, key): ...
def get_loc(self, key, method=..., tolerance=...): ...
def get_loc(self, key, tolerance=...): ...
def searchsorted(self, value, side: str = ..., sorter=...): ...
def is_type_compatible(self, typ) -> bool: ...
@property
Expand Down
4 changes: 1 addition & 3 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1056,8 +1056,6 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
self,
start_time: _str | time,
end_time: _str | time,
include_start: _bool = ...,
include_end: _bool = ...,
axis: SeriesAxisType | None = ...,
) -> Series[S1]: ...
def resample(
Expand All @@ -1082,7 +1080,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
self,
axis: SeriesAxisType = ...,
method: Literal["average", "min", "max", "first", "dense"] = ...,
numeric_only: _bool | None = ...,
numeric_only: _bool = ...,
na_option: Literal["keep", "top", "bottom"] = ...,
ascending: _bool = ...,
pct: _bool = ...,
Expand Down
3 changes: 0 additions & 3 deletions pandas-stubs/core/window/rolling.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class _Window(PandasObject, SelectionMixin):
def is_datetimelike(self) -> bool | None: ...
@property
def is_freq_type(self) -> bool: ...
def validate(self) -> None: ...
def __getattr__(self, attr: str): ...
def __iter__(self): ...
def aggregate(
Expand All @@ -53,7 +52,6 @@ class _Window(PandasObject, SelectionMixin):
) -> Scalar | DataFrame | Series: ...

class Window(_Window):
def validate(self) -> None: ...
def sum(self, *args, **kwargs): ...
def mean(self, *args, **kwargs): ...
def var(self, ddof: int = ..., *args, **kwargs): ...
Expand Down Expand Up @@ -104,7 +102,6 @@ class Rolling(_Rolling_and_Expanding):
window = ...
win_type: str = ...
min_periods: int = ...
def validate(self) -> None: ...
def count(self) -> DataFrame | Series: ...
def apply(
self,
Expand Down
Empty file added pandas-stubs/io/parsers.pyi
Empty file.
1 change: 1 addition & 0 deletions pandas-stubs/io/xml.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ from pandas._typing import (

def read_xml(
path_or_buffer: FilePath | ReadBuffer[bytes] | ReadBuffer[str],
*,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear why you added this??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deprecated passing positional arguments to read_xml in 1.4

Deprecated passing arguments as positional for read_xml() other than path_or_buffer (GH45133)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, the docs don't say anything about that, so maybe the docs should be updated as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are not mentioning positional deprecations in the docs

xpath: str = ...,
namespaces: dict[str, str] | None = ...,
elems_only: bool = ...,
Expand Down