File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
tests/series/arithmetic/timestamp Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -1892,6 +1892,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
1892
1892
self : Series [Timestamp ],
1893
1893
other : (
1894
1894
timedelta
1895
+ | Sequence [timedelta ]
1895
1896
| np .timedelta64
1896
1897
| np_ndarray_td
1897
1898
| TimedeltaIndex
@@ -2169,6 +2170,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
2169
2170
self : Series [Timestamp ],
2170
2171
other : (
2171
2172
timedelta
2173
+ | Sequence [timedelta ]
2172
2174
| np .timedelta64
2173
2175
| np_ndarray_td
2174
2176
| TimedeltaIndex
Original file line number Diff line number Diff line change @@ -92,16 +92,19 @@ def test_add_py_sequence() -> None:
92
92
93
93
if TYPE_CHECKING_INVALID_USAGE :
94
94
_0 = left + s # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
95
+ # Series[Timestamp] + Sequence[timedelta] should work, see pandas-dev/pandas#62353
95
96
_a = left + d # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
96
97
97
98
_1 = s + left # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
98
99
_b = d + left # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
99
100
100
- left .add (s ) # type: ignore[call-overload] # pyright: ignore[reportArgumentType,reportCallIssue]
101
- left .add (d ) # type: ignore[call-overload] # pyright: ignore[reportArgumentType,reportCallIssue]
101
+ if TYPE_CHECKING_INVALID_USAGE :
102
+ left .add (s ) # type: ignore[arg-type] # pyright: ignore[reportArgumentType,reportCallIssue]
103
+ left .add (d )
102
104
103
- left .radd (s ) # type: ignore[call-overload] # pyright: ignore[reportArgumentType,reportCallIssue]
104
- left .radd (d ) # type: ignore[call-overload] # pyright: ignore[reportArgumentType,reportCallIssue]
105
+ if TYPE_CHECKING_INVALID_USAGE :
106
+ left .radd (s ) # type: ignore[arg-type] # pyright: ignore[reportArgumentType,reportCallIssue]
107
+ left .radd (d )
105
108
106
109
107
110
def test_add_numpy_array () -> None :
Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ def test_sub_py_sequence() -> None:
86
86
d = [timedelta (seconds = 1 )]
87
87
88
88
if TYPE_CHECKING_INVALID_USAGE :
89
+ # Series[Timestamp] - Sequence[timestamp] should work, see pandas-dev/pandas#62353
89
90
_0 = left - s # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
91
+ # Series[Timestamp] - Sequence[timedelta] should work, see pandas-dev/pandas#62353
90
92
_a = left - d # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
91
93
92
94
_1 = s - left # type: ignore[operator] # pyright: ignore[reportOperatorIssue]
You can’t perform that action at this time.
0 commit comments