File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ def __init__(
457
457
# Check for pandas Series/ Index with object dtye
458
458
preserve_object_dtpe = False
459
459
if isinstance (values , (ABCSeries , ABCIndex )):
460
- if getattr ( values .dtype , "name" , None ) == "object" :
460
+ if values .dtype == "object" :
461
461
preserve_object_dtpe = True
462
462
if not isinstance (values , ABCIndex ):
463
463
# in particular RangeIndex xref test_index_equal_range_categories
@@ -475,7 +475,7 @@ def __init__(
475
475
"by passing in a categories argument."
476
476
) from err
477
477
478
- # If we should prserve object dtype, force categories to object dtype
478
+ # If we should preserve object dtype, force categories to object dtype
479
479
if preserve_object_dtpe :
480
480
# Only preserve object dtype if not all elements are strings
481
481
if not all (isinstance (x , str ) for x in categories ):
You can’t perform that action at this time.
0 commit comments