Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 15 additions & 15 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2101,22 +2101,25 @@ class Series(IndexOpsMixin[S1], NDFrame):
self: Series[Never], other: complex | _ListLike | Series
) -> Series: ...
@overload
def __truediv__(self, other: Series[Never]) -> Series: ... # type: ignore[overload-overlap]
def __truediv__(self, other: Series[Never]) -> Series: ...
@overload
def __truediv__(
self: Series[bool],
other: bool | np_ndarray_bool | Series[bool],
) -> Never: ...
def __truediv__(self: Series[bool], other: bool | np_ndarray_bool) -> Never: ...
@overload
def __truediv__(
def __truediv__( # pyright: ignore[reportOverlappingOverload]
self: Series[bool],
other: int | Sequence[int] | np_ndarray_anyint | np_ndarray_float | Series[int],
other: (
float
| Sequence[float]
| np_ndarray_anyint
| np_ndarray_float
| Series[int]
| Series[float]
),
) -> Series[float]: ...
@overload
def __truediv__( # type: ignore[overload-overlap]
self: Series[bool],
other: _T_NUM_NON_BOOL | Sequence[_T_NUM_NON_BOOL] | Series[_T_NUM_NON_BOOL],
) -> Series[_T_NUM_NON_BOOL]: ...
def __truediv__(
self: Series[bool], other: complex | Sequence[complex] | Series[complex]
) -> Series[complex]: ...
@overload
def __truediv__(
self: Series[int],
Expand Down Expand Up @@ -2283,10 +2286,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
@overload
def __rtruediv__(self: Series[Never], other: complex | _ListLike) -> Series: ...
@overload
def __rtruediv__(
self: Series[bool],
other: bool | np_ndarray_bool,
) -> Never: ...
def __rtruediv__(self: Series[bool], other: bool | np_ndarray_bool) -> Never: ...
@overload
def __rtruediv__(
self: Series[bool],
Expand Down
4 changes: 2 additions & 2 deletions tests/series/arithmetic/bool/test_truediv.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ def test_truediv_pd_series() -> None:
c = pd.Series([1.1j, 2.2j, 4.1j])

if TYPE_CHECKING_INVALID_USAGE:
assert_type(left / b, Never)
_ = left / b # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
check(assert_type(left / i, "pd.Series[float]"), pd.Series, np.floating)
check(assert_type(left / f, "pd.Series[float]"), pd.Series, np.floating)
check(assert_type(left / c, "pd.Series[complex]"), pd.Series, np.complexfloating)

if TYPE_CHECKING_INVALID_USAGE:
assert_type(b / left, Never)
_ = b / left # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
check(assert_type(i / left, "pd.Series[float]"), pd.Series, np.floating)
check(assert_type(f / left, "pd.Series[float]"), pd.Series, np.floating)
check(assert_type(c / left, "pd.Series[complex]"), pd.Series, np.complexfloating)
Expand Down
2 changes: 1 addition & 1 deletion tests/series/arithmetic/test_truediv.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_truediv_pd_series() -> None:
check(assert_type(left / f, pd.Series), pd.Series)
check(assert_type(left / c, pd.Series), pd.Series)

check(assert_type(b / left, pd.Series), pd.Series) # type: ignore[assert-type]
check(assert_type(b / left, pd.Series), pd.Series)
check(assert_type(i / left, pd.Series), pd.Series)
check(assert_type(f / left, pd.Series), pd.Series)
check(assert_type(c / left, pd.Series), pd.Series)
Expand Down
2 changes: 1 addition & 1 deletion tests/series/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ def test_series_min_max_sub_axis() -> None:
check(assert_type(sa, pd.Series), pd.Series)
check(assert_type(ss, pd.Series), pd.Series)
check(assert_type(sm, pd.Series), pd.Series)
check(assert_type(sd, pd.Series), pd.Series) # type: ignore[assert-type]
check(assert_type(sd, pd.Series), pd.Series)


def test_series_index_isin() -> None:
Expand Down
Loading