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__(
457457 # Check for pandas Series/ Index with object dtye
458458 preserve_object_dtpe = False
459459 if isinstance (values , (ABCSeries , ABCIndex )):
460- if getattr ( values .dtype , "name" , None ) == "object" :
460+ if values .dtype == "object" :
461461 preserve_object_dtpe = True
462462 if not isinstance (values , ABCIndex ):
463463 # in particular RangeIndex xref test_index_equal_range_categories
@@ -475,7 +475,7 @@ def __init__(
475475 "by passing in a categories argument."
476476 ) from err
477477
478- # If we should prserve object dtype, force categories to object dtype
478+ # If we should preserve object dtype, force categories to object dtype
479479 if preserve_object_dtpe :
480480 # Only preserve object dtype if not all elements are strings
481481 if not all (isinstance (x , str ) for x in categories ):
You can’t perform that action at this time.
0 commit comments