Skip to content

Commit a20c959

Browse files
committed
changes in the last commit
1 parent d032a6e commit a20c959

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/core/arrays/integer.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
is_object_dtype,
2121
is_scalar,
2222
)
23-
from pandas.core.dtypes.dtypes import register_extension_dtype, CategoricalDtype
23+
from pandas.core.dtypes.dtypes import register_extension_dtype
24+
from pandas import Categorical
2425
from pandas.core.dtypes.missing import isna, notna
2526

2627
from pandas.core import nanops, ops
@@ -208,7 +209,7 @@ def coerce_to_array(values, dtype, mask=None, copy=False):
208209

209210

210211
if hasattr(values, "dtype"):
211-
if copy and values.dtype!=CategoricalDtype():
212+
if copy and not isinstance(values, Categorical):
212213
values = values.copy()
213214
else:
214215
if isinstance(values, list):

0 commit comments

Comments
 (0)