File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
- from typing import TYPE_CHECKING
3
+ from typing import (
4
+ TYPE_CHECKING ,
5
+ cast ,
6
+ )
4
7
5
8
import numpy as np
6
9
49
52
from pandas import (
50
53
DatetimeIndex ,
51
54
Series ,
52
- TimedeltaArray ,
53
55
TimedeltaIndex ,
54
56
)
57
+ from pandas .core .arrays import TimedeltaArray
55
58
from pandas .core .arrays .datetimelike import DatetimeLikeArrayMixin
56
59
# ---------------------------------------------------------------------
57
60
# Offset names ("time rules") and related functions
@@ -177,7 +180,8 @@ def infer_freq(
177
180
raise TypeError (
178
181
f"cannot infer freq from a non-convertible index of dtype { index .dtype } "
179
182
)
180
- index : TimedeltaArray = index
183
+
184
+ index = cast ("TimedeltaArray" , index )
181
185
182
186
if not isinstance (index , DatetimeIndex ):
183
187
index = DatetimeIndex (index )
You can’t perform that action at this time.
0 commit comments