Skip to content

Commit d57ec7a

Browse files
committed
fix(comment): reduce ignores
1 parent c823f21 commit d57ec7a

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

pandas-stubs/core/series.pyi

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,22 +2101,25 @@ class Series(IndexOpsMixin[S1], NDFrame):
21012101
self: Series[Never], other: complex | _ListLike | Series
21022102
) -> Series: ...
21032103
@overload
2104-
def __truediv__(self, other: Series[Never]) -> Series: ... # type: ignore[overload-overlap]
2104+
def __truediv__(self, other: Series[Never]) -> Series: ...
21052105
@overload
2106-
def __truediv__(
2107-
self: Series[bool],
2108-
other: bool | np_ndarray_bool | Series[bool],
2109-
) -> Never: ...
2106+
def __truediv__(self: Series[bool], other: bool | np_ndarray_bool) -> Never: ...
21102107
@overload
2111-
def __truediv__(
2108+
def __truediv__( # pyright: ignore[reportOverlappingOverload]
21122109
self: Series[bool],
2113-
other: int | Sequence[int] | np_ndarray_anyint | np_ndarray_float | Series[int],
2110+
other: (
2111+
float
2112+
| Sequence[float]
2113+
| np_ndarray_anyint
2114+
| np_ndarray_float
2115+
| Series[int]
2116+
| Series[float]
2117+
),
21142118
) -> Series[float]: ...
21152119
@overload
2116-
def __truediv__( # type: ignore[overload-overlap]
2117-
self: Series[bool],
2118-
other: _T_NUM_NON_BOOL | Sequence[_T_NUM_NON_BOOL] | Series[_T_NUM_NON_BOOL],
2119-
) -> Series[_T_NUM_NON_BOOL]: ...
2120+
def __truediv__(
2121+
self: Series[bool], other: complex | Sequence[complex] | Series[complex]
2122+
) -> Series[complex]: ...
21202123
@overload
21212124
def __truediv__(
21222125
self: Series[int],
@@ -2283,10 +2286,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
22832286
@overload
22842287
def __rtruediv__(self: Series[Never], other: complex | _ListLike) -> Series: ...
22852288
@overload
2286-
def __rtruediv__(
2287-
self: Series[bool],
2288-
other: bool | np_ndarray_bool,
2289-
) -> Never: ...
2289+
def __rtruediv__(self: Series[bool], other: bool | np_ndarray_bool) -> Never: ...
22902290
@overload
22912291
def __rtruediv__(
22922292
self: Series[bool],

tests/series/arithmetic/bool/test_truediv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,13 @@ def test_truediv_pd_series() -> None:
179179
c = pd.Series([1.1j, 2.2j, 4.1j])
180180

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

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

tests/series/arithmetic/test_truediv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_truediv_pd_series() -> None:
145145
check(assert_type(left / f, pd.Series), pd.Series)
146146
check(assert_type(left / c, pd.Series), pd.Series)
147147

148-
check(assert_type(b / left, pd.Series), pd.Series) # type: ignore[assert-type]
148+
check(assert_type(b / left, pd.Series), pd.Series)
149149
check(assert_type(i / left, pd.Series), pd.Series)
150150
check(assert_type(f / left, pd.Series), pd.Series)
151151
check(assert_type(c / left, pd.Series), pd.Series)

tests/series/test_series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ def test_series_min_max_sub_axis() -> None:
16071607
check(assert_type(sa, pd.Series), pd.Series)
16081608
check(assert_type(ss, pd.Series), pd.Series)
16091609
check(assert_type(sm, pd.Series), pd.Series)
1610-
check(assert_type(sd, pd.Series), pd.Series) # type: ignore[assert-type]
1610+
check(assert_type(sd, pd.Series), pd.Series)
16111611

16121612

16131613
def test_series_index_isin() -> None:

0 commit comments

Comments
 (0)