Skip to content

Commit c409d62

Browse files
committed
remove ignore[assignment] from pandas/tseries/frequencies.py
1 parent cfbbeb6 commit c409d62

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pandas/tseries/frequencies.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,12 @@ def infer_freq(
174174
return inferer.get_freq()
175175

176176
if isinstance(index, Index) and not isinstance(index, DatetimeIndex):
177+
values = index._values
177178
if index.dtype.kind in "iufcb":
178179
raise TypeError(
179180
f"cannot infer freq from a non-convertible index of dtype {index.dtype}"
180181
)
181-
# error: Incompatible types in assignment (expression has type
182-
# "Union[ExtensionArray, ndarray[Any, Any]]", variable has type
183-
# "Union[DatetimeIndex, TimedeltaIndex, Series, DatetimeLikeArrayMixin]")
184-
index = index._values # type: ignore[assignment]
182+
index = values
185183

186184
if not isinstance(index, DatetimeIndex):
187185
index = DatetimeIndex(index)

0 commit comments

Comments
 (0)