From 41451891f7542ac16e56394ad43c9bc771d5b95a Mon Sep 17 00:00:00 2001 From: Ali Hamdan Date: Thu, 30 May 2024 15:59:22 +0200 Subject: [PATCH] pandas 2.0 removals in core/indexes (#931) --- pandas-stubs/core/indexes/base.pyi | 8 -------- pandas-stubs/core/indexes/category.pyi | 1 - pandas-stubs/core/indexes/datetimes.pyi | 2 -- pandas-stubs/core/indexes/interval.pyi | 4 ---- pandas-stubs/core/indexes/multi.pyi | 3 --- pandas-stubs/core/indexes/period.pyi | 1 - pandas-stubs/core/indexes/timedeltas.pyi | 1 - 7 files changed, 20 deletions(-) diff --git a/pandas-stubs/core/indexes/base.pyi b/pandas-stubs/core/indexes/base.pyi index f25ddd6d..388b3d33 100644 --- a/pandas-stubs/core/indexes/base.pyi +++ b/pandas-stubs/core/indexes/base.pyi @@ -55,7 +55,6 @@ from pandas._typing import ( np_ndarray_bool, np_ndarray_complex, np_ndarray_float, - np_ndarray_int64, type_t, ) @@ -262,8 +261,6 @@ class Index(IndexOpsMixin[S1]): ) -> Self: ... @property def str(self) -> StringMethods[Self, MultiIndex]: ... - @property - def asi8(self) -> np_ndarray_int64: ... def is_(self, other) -> bool: ... def __len__(self) -> int: ... def __array__(self, dtype=...) -> np.ndarray: ... @@ -283,7 +280,6 @@ class Index(IndexOpsMixin[S1]): def format( self, name: bool = ..., formatter: Callable | None = ..., na_rep: _str = ... ) -> list[_str]: ... - def to_native_types(self, slicer=..., **kwargs): ... def to_flat_index(self): ... def to_series(self, index=..., name=...) -> Series: ... def to_frame(self, index: bool = ..., name=...) -> DataFrame: ... @@ -317,7 +313,6 @@ class Index(IndexOpsMixin[S1]): def is_object(self) -> bool: ... def is_categorical(self) -> bool: ... def is_interval(self) -> bool: ... - def is_mixed(self) -> bool: ... def holds_integer(self): ... @property def inferred_type(self) -> _str: ... @@ -373,7 +368,6 @@ class Index(IndexOpsMixin[S1]): def array(self) -> ExtensionArray: ... def memory_usage(self, deep: bool = ...): ... def where(self, cond, other=...): ... - def is_type_compatible(self, kind) -> bool: ... def __contains__(self, key) -> bool: ... def __setitem__(self, key, value) -> None: ... @overload @@ -401,8 +395,6 @@ class Index(IndexOpsMixin[S1]): def sort(self, *args, **kwargs) -> None: ... def shift(self, periods: int = ..., freq=...) -> None: ... def argsort(self, *args, **kwargs): ... - def get_value(self, series, key): ... - def set_value(self, arr, key, value) -> None: ... def get_indexer_non_unique(self, target): ... def get_indexer_for(self, target, **kwargs): ... @final diff --git a/pandas-stubs/core/indexes/category.pyi b/pandas-stubs/core/indexes/category.pyi index a8ba4d0d..24efa77b 100644 --- a/pandas-stubs/core/indexes/category.pyi +++ b/pandas-stubs/core/indexes/category.pyi @@ -45,6 +45,5 @@ class CategoricalIndex(ExtensionIndex[S1], accessor.PandasDelegate): def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ... def get_indexer(self, target, method=..., limit=..., tolerance=...): ... def get_indexer_non_unique(self, target): ... - def take_nd(self, *args, **kwargs): ... def delete(self, loc): ... def insert(self, loc, item): ... diff --git a/pandas-stubs/core/indexes/datetimes.pyi b/pandas-stubs/core/indexes/datetimes.pyi index 6d23fe56..b1f73409 100644 --- a/pandas-stubs/core/indexes/datetimes.pyi +++ b/pandas-stubs/core/indexes/datetimes.pyi @@ -71,7 +71,6 @@ class DatetimeIndex(DatetimeTimedeltaMixin[Timestamp], DatetimeIndexProperties): ) -> TimedeltaIndex: ... def to_series(self, index=..., name=...) -> TimestampSeries: ... def snap(self, freq: str = ...): ... - def get_value(self, series, key): ... def slice_indexer(self, start=..., end=..., step=...): ... def searchsorted(self, value, side: str = ..., sorter=...): ... @property @@ -81,7 +80,6 @@ class DatetimeIndex(DatetimeTimedeltaMixin[Timestamp], DatetimeIndexProperties): def indexer_between_time( self, start_time, end_time, include_start: bool = ..., include_end: bool = ... ): ... - def to_perioddelta(self, freq) -> TimedeltaIndex: ... def to_julian_date(self) -> Index[float]: ... def isocalendar(self) -> DataFrame: ... @property diff --git a/pandas-stubs/core/indexes/interval.pyi b/pandas-stubs/core/indexes/interval.pyi index 22488233..5e675290 100644 --- a/pandas-stubs/core/indexes/interval.pyi +++ b/pandas-stubs/core/indexes/interval.pyi @@ -37,7 +37,6 @@ from pandas._typing import ( ) from pandas.core.dtypes.dtypes import IntervalDtype as IntervalDtype -from pandas.core.dtypes.generic import ABCSeries _EdgesInt: TypeAlias = ( Sequence[int] @@ -247,7 +246,6 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin): def mid(self) -> Index: ... @property def length(self) -> Index: ... - def get_value(self, series: ABCSeries, key): ... @overload # type: ignore[override] def __getitem__( self, @@ -264,8 +262,6 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin): def __getitem__( # pyright: ignore[reportIncompatibleMethodOverride] self, idx: int ) -> IntervalT: ... - @property - def is_all_dates(self) -> bool: ... @overload # type: ignore[override] def __gt__( self, other: IntervalT | IntervalIndex[IntervalT] diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index 0da84bb4..847ca736 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -96,7 +96,6 @@ class MultiIndex(Index[Any]): def duplicated(self, keep: Literal["first", "last", False] = ...): ... def fillna(self, value=..., downcast=...) -> None: ... def dropna(self, how: Literal["any", "all"] = ...) -> Self: ... - def get_value(self, series, key): ... def get_level_values(self, level: str | int) -> Index: ... def unique(self, level=...): ... def to_frame( @@ -106,8 +105,6 @@ class MultiIndex(Index[Any]): allow_duplicates: bool = ..., ) -> pd.DataFrame: ... def to_flat_index(self): ... - @property - def is_all_dates(self) -> bool: ... def remove_unused_levels(self): ... @property def nlevels(self) -> int: ... diff --git a/pandas-stubs/core/indexes/period.pyi b/pandas-stubs/core/indexes/period.pyi index 32d2aba1..730c9b60 100644 --- a/pandas-stubs/core/indexes/period.pyi +++ b/pandas-stubs/core/indexes/period.pyi @@ -59,7 +59,6 @@ class PeriodIndex(DatetimeIndexOpsMixin[pd.Period], PeriodIndexFieldOps): def is_full(self) -> bool: ... @property def inferred_type(self) -> str: ... - def get_value(self, series, key): ... def get_indexer(self, target, method=..., limit=..., tolerance=...): ... def get_indexer_non_unique(self, target): ... def insert(self, loc, item): ... diff --git a/pandas-stubs/core/indexes/timedeltas.pyi b/pandas-stubs/core/indexes/timedeltas.pyi index 3e771a33..921f9e84 100644 --- a/pandas-stubs/core/indexes/timedeltas.pyi +++ b/pandas-stubs/core/indexes/timedeltas.pyi @@ -72,7 +72,6 @@ class TimedeltaIndex(DatetimeTimedeltaMixin[Timedelta], TimedeltaIndexProperties ) -> Index[int]: ... def __rfloordiv__(self, other: dt.timedelta | Sequence[dt.timedelta]) -> Index[int]: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] def astype(self, dtype, copy: bool = ...): ... - def get_value(self, series, key): ... def searchsorted(self, value, side: str = ..., sorter=...): ... @property def inferred_type(self) -> str: ...