Skip to content

Commit

Permalink
pandas 2.0 removals in core/arrays (#932)
Browse files Browse the repository at this point in the history
* Fix CI from PR 930

* pandas 2.0 removals in core/arrays

* Revert "Fix CI from PR 930"

This reverts commit 6ecbab9.
  • Loading branch information
hamdanal authored May 30, 2024
1 parent 4145189 commit 7f58060
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 74 deletions.
79 changes: 7 additions & 72 deletions pandas-stubs/core/arrays/categorical.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ from collections.abc import (
Callable,
Sequence,
)
from typing import (
Any,
Literal,
overload,
)
from typing import Any

import numpy as np
from pandas import Series
Expand Down Expand Up @@ -48,7 +44,6 @@ class Categorical(ExtensionArray):
def dtype(self) -> CategoricalDtype: ...
def astype(self, dtype: Dtype, copy: bool = ...) -> ArrayLike: ...
def size(self) -> int: ...
def itemsize(self) -> int: ...
def tolist(self) -> list[Scalar]: ...
to_list = ...
@classmethod
Expand All @@ -65,72 +60,16 @@ class Categorical(ExtensionArray):
def set_ordered(self, value) -> Categorical: ...
def as_ordered(self) -> Categorical: ...
def as_unordered(self) -> Categorical: ...
@overload
def set_categories(
self, new_categories, ordered=..., rename: bool = ..., *, inplace: Literal[True]
) -> None: ...
@overload
def set_categories(
self,
new_categories,
ordered=...,
rename: bool = ...,
inplace: Literal[False] = ...,
) -> Categorical: ...
@overload
def set_categories(
self, new_categories, ordered=..., rename: bool = ..., inplace: bool = ...
) -> Categorical | None: ...
@overload
def rename_categories(self, new_categories, inplace: Literal[True]) -> None: ...
@overload
def rename_categories(
self, new_categories, inplace: Literal[False] = ...
self, new_categories, ordered: bool | None = ..., rename: bool = ...
) -> Categorical: ...
@overload
def rename_categories(
self, new_categories, inplace: bool = ...
) -> Categorical | None: ...
@overload
def reorder_categories(
self, new_categories, ordered=..., *, inplace: Literal[True]
) -> None: ...
@overload
def rename_categories(self, new_categories) -> Categorical: ...
def reorder_categories(
self, new_categories, ordered=..., inplace: Literal[False] = ...
) -> Categorical: ...
@overload
def reorder_categories(
self, new_categories, ordered=..., inplace: bool = ...
) -> Categorical | None: ...
@overload
def add_categories(self, new_categories, inplace: Literal[True]) -> None: ...
@overload
def add_categories(
self, new_categories, inplace: Literal[False] = ...
) -> Categorical: ...
@overload
def add_categories(
self, new_categories, inplace: bool = ...
) -> Categorical | None: ...
@overload
def remove_categories(self, removals, inplace: Literal[True]) -> None: ...
@overload
def remove_categories(
self, removals, inplace: Literal[False] = ...
) -> Categorical: ...
@overload
def remove_categories(
self, removals, inplace: bool = ...
) -> Categorical | None: ...
@overload
def remove_unused_categories(self, inplace: Literal[True]) -> None: ...
@overload
def remove_unused_categories(
self, inplace: Literal[False] = ...
self, new_categories, ordered: bool | None = ...
) -> Categorical: ...
@overload
def remove_unused_categories(self, inplace: bool = ...) -> Categorical | None: ...
def add_categories(self, new_categories) -> Categorical: ...
def remove_categories(self, removals) -> Categorical: ...
def remove_unused_categories(self) -> Categorical: ...
def map(self, mapper): ...
def __eq__(self, other) -> bool: ...
def __ne__(self, other) -> bool: ...
Expand Down Expand Up @@ -161,23 +100,19 @@ class Categorical(ExtensionArray):
self, *, inplace: bool = ..., ascending: bool = ..., na_position: str = ...
): ...
def view(self, dtype=...): ...
def to_dense(self): ...
def fillna(self, value=..., method=..., limit=...): ...
def take(
self, indexer: TakeIndexer, *, allow_fill: bool = ..., fill_value=...
) -> Categorical: ...
def take_nd(self, indexer, allow_fill: bool = ..., fill_value=...): ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __contains__(self, key) -> bool: ...
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
def min(self, *, skipna: bool = ...): ...
def max(self, *, skipna: bool = ...): ...
def mode(self, dropna: bool = ...): ...
def unique(self): ...
def equals(self, other): ...
def is_dtype_equal(self, other): ...
def describe(self): ...
def repeat(self, repeats, axis=...): ...
def isin(self, values): ...
Expand Down
2 changes: 0 additions & 2 deletions pandas-stubs/core/arrays/datetimes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ class DatetimeArray(DatetimeLikeArrayMixin, TimelikeOps, DatelikeOps):
second = ...
microsecond = ...
nanosecond = ...
weekofyear = ...
week = ...
dayofweek = ...
weekday = ...
dayofyear = ...
Expand Down

0 comments on commit 7f58060

Please sign in to comment.