Skip to content

Commit 09aeaf7

Browse files
committed
feat(test): mul
1 parent 61b83ce commit 09aeaf7

34 files changed

+416
-122
lines changed

pandas-stubs/core/arraylike.pyi

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ class OpsMixin:
1919
def __rxor__(self, other: Any) -> Self: ...
2020
# -------------------------------------------------------------
2121
# Arithmetic Methods
22-
def __mul__(self, other: Any) -> Self: ...
23-
def __rmul__(self, other: Any) -> Self: ...
24-
# Handled by subclasses that specify only the valid values
25-
# that can be passed
26-
# def __truediv__(self, other: Any) -> Self: ...
27-
# def __rtruediv__(self, other: Any) -> Self: ...
28-
# def __floordiv__(self, other: Any) -> Self: ...
29-
# def __rfloordiv__(self, other: Any) -> Self: ...
3022
def __mod__(self, other: Any) -> Self: ...
3123
def __rmod__(self, other: Any) -> Self: ...
3224
def __divmod__(self, other: Any) -> tuple[Self, Self]: ...

pandas-stubs/core/frame.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
18061806
level: Level | None = ...,
18071807
fill_value: float | None = None,
18081808
) -> Self: ...
1809+
def __mul__(self, other: Any) -> Self: ...
1810+
def __rmul__(self, other: Any) -> Self: ...
18091811
@final
18101812
def add_prefix(self, prefix: _str, axis: Axis | None = None) -> Self: ...
18111813
@final

pandas-stubs/core/indexes/base.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ class Index(IndexOpsMixin[S1]):
630630
@overload
631631
def __sub__(self: Index[Never], other: DatetimeIndex) -> Never: ...
632632
@overload
633-
def __sub__(self: Index[Never], other: complex | NumListLike | Index) -> Index: ...
633+
def __sub__(self: Index[Never], other: complex | _ListLike | Index) -> Index: ...
634634
@overload
635635
def __sub__(self, other: Index[Never]) -> Index: ...
636636
@overload
@@ -770,7 +770,8 @@ class Index(IndexOpsMixin[S1]):
770770
self: Index[int] | Index[float], other: timedelta
771771
) -> TimedeltaIndex: ...
772772
@overload
773-
def __mul__(self, other: Any) -> Self: ...
773+
def __mul__(self, other: S1 | Sequence[S1] | Index[S1]) -> Self: ...
774+
def __rmul__(self, other: S1 | Sequence[S1] | Index[S1]) -> Self: ...
774775
def __floordiv__(
775776
self,
776777
other: (

pandas-stubs/core/indexes/timedeltas.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ class TimedeltaIndex(
6262
def __sub__( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
6363
self, other: dt.timedelta | np.timedelta64 | np_ndarray_td | Self
6464
) -> Self: ...
65-
def __mul__(self, other: num) -> Self: ...
65+
def __mul__(self, other: float) -> Self: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
6666
@overload # type: ignore[override]
67-
def __truediv__(self, other: num | Sequence[float]) -> Self: ...
67+
def __truediv__(self, other: float | Sequence[float]) -> Self: ...
6868
@overload
6969
def __truediv__( # pyright: ignore[reportIncompatibleMethodOverride]
7070
self, other: dt.timedelta | Sequence[dt.timedelta]

pandas-stubs/core/series.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2457,7 +2457,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
24572457
self, other: S1 | _ListLike | Series[S1] | datetime | timedelta | date
24582458
) -> Series[_bool]: ...
24592459
@overload
2460-
def __mul__(
2460+
def __mul__( # type: ignore[overload-overlap]
24612461
self: Series[Never], other: complex | NumListLike | Series
24622462
) -> Series: ...
24632463
@overload
@@ -2532,6 +2532,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
25322532
),
25332533
) -> Series[Timedelta]: ...
25342534
@overload
2535+
def __mul__(self: Series[Timedelta], other: np_ndarray_complex) -> Never: ...
2536+
@overload
25352537
def __mul__(
25362538
self: Series[Timedelta],
25372539
other: (
@@ -2704,7 +2706,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
27042706
axis: AxisIndex | None = 0,
27052707
) -> Series[Timedelta]: ...
27062708
@overload
2707-
def __rmul__(
2709+
def __rmul__( # type: ignore[overload-overlap]
27082710
self: Series[Never], other: complex | NumListLike | Series
27092711
) -> Series: ...
27102712
@overload
@@ -2778,6 +2780,8 @@ class Series(IndexOpsMixin[S1], NDFrame):
27782780
),
27792781
) -> Series[Timedelta]: ...
27802782
@overload
2783+
def __rmul__(self: Series[Timedelta], other: np_ndarray_complex) -> Never: ...
2784+
@overload
27812785
def __rmul__(
27822786
self: Series[Timedelta],
27832787
other: (

tests/indexes/arithmetic/bool/test_add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_add_numpy_array() -> None:
6666

6767

6868
def test_add_pd_index() -> None:
69-
"""Test pd.Index[bool] + pandas index"""
69+
"""Test pd.Index[bool] + pandas indexes"""
7070
b = pd.Index([True, False, True])
7171
i = pd.Index([2, 3, 5])
7272
f = pd.Index([1.0, 2.0, 3.0])

tests/indexes/arithmetic/bool/test_sub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_sub_numpy_array() -> None:
7676

7777

7878
def test_sub_pd_index() -> None:
79-
"""Test pd.Index[bool] - pandas index"""
79+
"""Test pd.Index[bool] - pandas indexes"""
8080
b = pd.Index([True, False, True])
8181
i = pd.Index([2, 3, 5])
8282
f = pd.Index([1.0, 2.0, 3.0])

tests/indexes/arithmetic/complex/test_add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_add_numpy_array() -> None:
6767

6868

6969
def test_add_pd_index() -> None:
70-
"""Test pd.Index[complex] + pandas index"""
70+
"""Test pd.Index[complex] + pandas indexes"""
7171
b = pd.Index([True, False, True])
7272
i = pd.Index([2, 3, 5])
7373
f = pd.Index([1.0, 2.0, 3.0])

tests/indexes/arithmetic/complex/test_sub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_sub_numpy_array() -> None:
6969

7070

7171
def test_sub_pd_index() -> None:
72-
"""Test pd.Index[complex] - pandas index"""
72+
"""Test pd.Index[complex] - pandas indexes"""
7373
b = pd.Index([True, False, True])
7474
i = pd.Index([2, 3, 5])
7575
f = pd.Index([1.0, 2.0, 3.0])

tests/indexes/arithmetic/float/test_add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_add_numpy_array() -> None:
6565

6666

6767
def test_add_pd_index() -> None:
68-
"""Test pd.Index[float] + pandas index"""
68+
"""Test pd.Index[float] + pandas indexes"""
6969
b = pd.Index([True, False, True])
7070
i = pd.Index([2, 3, 5])
7171
f = pd.Index([1.0, 2.0, 3.0])

0 commit comments

Comments
 (0)