File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ from pandas._libs.tslibs.timedeltas import TimeDeltaUnitChoices
14
14
from pandas ._typing import (
15
15
ArrayLike ,
16
16
RaiseCoerce ,
17
+ SequenceNotStr ,
17
18
)
18
19
19
20
@overload
@@ -31,7 +32,8 @@ def to_timedelta(
31
32
@overload
32
33
def to_timedelta (
33
34
arg : (
34
- Sequence [str | float | timedelta ]
35
+ SequenceNotStr [str ]
36
+ | Sequence [float | timedelta ]
35
37
| tuple [str | float | timedelta , ...]
36
38
| range
37
39
| ArrayLike
Original file line number Diff line number Diff line change 25
25
from pandas ._typing import FulldatetimeDict
26
26
else :
27
27
FulldatetimeDict = Any
28
- from pandas ._typing import TimeUnit
28
+ from pandas ._typing import (
29
+ SequenceNotStr ,
30
+ TimeUnit ,
31
+ )
29
32
30
33
from tests import (
31
34
PD_LTE_22 ,
@@ -141,7 +144,8 @@ def test_timedelta_series_arithmetic() -> None:
141
144
142
145
143
146
def test_timedelta_series_string () -> None :
144
- check (assert_type (pd .to_timedelta (["1 day" ]), pd .TimedeltaIndex ), pd .TimedeltaIndex )
147
+ seq_list : SequenceNotStr [str ] = ["1 day" ]
148
+ check (assert_type (pd .to_timedelta (seq_list ), pd .TimedeltaIndex ), pd .TimedeltaIndex )
145
149
146
150
147
151
def test_timestamp_timedelta_series_arithmetic () -> None :
You can’t perform that action at this time.
0 commit comments