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 30
30
PeriodDtype ,
31
31
SparseDtype ,
32
32
)
33
- from pandas .core .dtypes .generic import ABCIndex
34
33
from pandas .core .dtypes .inference import (
35
34
is_array_like ,
36
35
is_bool ,
@@ -1235,21 +1234,7 @@ def is_bool_dtype(arr_or_dtype) -> bool:
1235
1234
arr_or_dtype = dtype .categories
1236
1235
# now we use the special definition for Index
1237
1236
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 ):
1253
1238
return getattr (dtype , "_is_boolean" , False )
1254
1239
1255
1240
return issubclass (dtype .type , np .bool_ )
You can’t perform that action at this time.
0 commit comments