Skip to content

Commit 20c2620

Browse files
committed
fix mypy error with # type: ignore
1 parent b5cd73c commit 20c2620

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pandas/core/dtypes/cast.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
is_timedelta64_dtype,
5656
is_timedelta64_ns_dtype,
5757
is_unsigned_integer_dtype,
58-
needs_i8_conversion,
5958
pandas_dtype,
6059
)
6160
from pandas.core.dtypes.dtypes import (
@@ -496,10 +495,8 @@ def maybe_casted_values(index, codes=None):
496495
if mask.any():
497496
values, _ = maybe_upcast_putmask(values, mask, np.nan)
498497

499-
from pandas.core.arrays import ExtensionArray
500-
501-
if needs_i8_conversion(values.dtype) and isinstance(values, ExtensionArray):
502-
values = values_type(values, dtype=values_dtype)
498+
if issubclass(values_type, DatetimeLikeArrayMixin):
499+
values = values_type(values, dtype=values_dtype) # type: ignore
503500

504501
return values
505502

0 commit comments

Comments
 (0)