File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change 3030 PeriodDtype ,
3131 SparseDtype ,
3232)
33- from pandas .core .dtypes .generic import ABCIndex
3433from pandas .core .dtypes .inference import (
3534 is_array_like ,
3635 is_bool ,
@@ -1235,21 +1234,7 @@ def is_bool_dtype(arr_or_dtype) -> bool:
12351234 arr_or_dtype = dtype .categories
12361235 # now we use the special definition for Index
12371236
1238- if isinstance (arr_or_dtype , ABCIndex ):
1239- # Allow Index[object] that is all-bools or Index["boolean"]
1240- if arr_or_dtype .inferred_type == "boolean" :
1241- if not is_bool_dtype (arr_or_dtype .dtype ):
1242- # GH#52680
1243- warnings .warn (
1244- "The behavior of is_bool_dtype with an object-dtype Index "
1245- "of bool objects is deprecated. In a future version, "
1246- "this will return False. Cast the Index to a bool dtype instead." ,
1247- DeprecationWarning ,
1248- stacklevel = 2 ,
1249- )
1250- return True
1251- return False
1252- elif isinstance (dtype , ExtensionDtype ):
1237+ if isinstance (dtype , ExtensionDtype ):
12531238 return getattr (dtype , "_is_boolean" , False )
12541239
12551240 return issubclass (dtype .type , np .bool_ )
You can’t perform that action at this time.
0 commit comments