Skip to content

TYP: pandas.core.series annotations from pandas-stubs #47926

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 5 commits into from
Aug 15, 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
4 changes: 2 additions & 2 deletions pandas/_testing/asserters.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def assert_series_equal(
left,
right,
check_dtype: bool | Literal["equiv"] = True,
check_index_type="equiv",
check_index_type: bool | Literal["equiv"] = "equiv",
check_series_type=True,
check_less_precise: bool | int | NoDefault = no_default,
check_names=True,
Expand Down Expand Up @@ -1134,7 +1134,7 @@ def assert_frame_equal(
left,
right,
check_dtype: bool | Literal["equiv"] = True,
check_index_type="equiv",
check_index_type: bool | Literal["equiv"] = "equiv",
check_column_type="equiv",
check_frame_type=True,
check_less_precise=no_default,
Expand Down
4 changes: 2 additions & 2 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
Timedelta,
Timestamp,
)
from pandas._libs.tslibs import BaseOffset

from pandas.core.dtypes.dtypes import ExtensionDtype

Expand All @@ -63,7 +64,6 @@
from pandas.core.window.rolling import BaseWindow

from pandas.io.formats.format import EngFormatter
from pandas.tseries.offsets import DateOffset

# numpy compatible types
NumpyValueArrayLike = Union[npt._ScalarLike_co, npt.ArrayLike]
Expand Down Expand Up @@ -113,7 +113,7 @@
Suffixes = Tuple[Optional[str], Optional[str]]
Ordered = Optional[bool]
JSONSerializable = Optional[Union[PythonScalar, List, Dict]]
Frequency = Union[str, "DateOffset"]
Frequency = Union[str, "BaseOffset"]
Axes = Union[AnyArrayLike, List, range]

RandomState = Union[
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ def equals(self, other: object) -> bool:
equal_na = self.isna() & other.isna() # type: ignore[operator]
return bool((equal_values | equal_na).all())

def isin(self, values) -> np.ndarray:
def isin(self, values) -> npt.NDArray[np.bool_]:
"""
Pointwise comparison for set containment in the given values.

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,7 @@ def contains(self, other):
other < self._right if self.open_right else other <= self._right
)

def isin(self, values) -> np.ndarray:
def isin(self, values) -> npt.NDArray[np.bool_]:
if not hasattr(values, "dtype"):
values = np.array(values)
values = extract_array(values, extract_numpy=True)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/string_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _maybe_convert_setitem_value(self, value):
raise ValueError("Scalar must be NA or str")
return value

def isin(self, values):
def isin(self, values) -> npt.NDArray[np.bool_]:
if pa_version_under2p0:
fallback_performancewarning(version="2")
return super().isin(values)
Expand Down
Loading