Skip to content

Commit

Permalink
add missing import
Browse files Browse the repository at this point in the history
  • Loading branch information
arw2019 committed Oct 10, 2020
1 parent a5dd352 commit c349f82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,16 @@ def maybe_casted_values(index, codes=None):
values_type = type(values)
values_dtype = values.dtype

if needs_i8_conversion(values.dtype) and isinstance(values, ExtensionArray):
from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin

if isinstance(values, DatetimeLikeArrayMixin):
values = values._data # TODO: can we de-kludge yet?

if mask.any():
values, _ = maybe_upcast_putmask(values, mask, np.nan)

from pandas.core.arrays import ExtensionArray

if needs_i8_conversion(values.dtype) and isinstance(values, ExtensionArray):
values = values_type(values, dtype=values_dtype)

Expand Down

0 comments on commit c349f82

Please sign in to comment.