File tree 3 files changed +3
-22
lines changed
3 files changed +3
-22
lines changed Original file line number Diff line number Diff line change 17
17
from pandas .core .dtypes .cast import maybe_promote
18
18
from pandas .core .dtypes .common import (
19
19
ensure_platform_int ,
20
- is_1d_only_ea_obj ,
20
+ is_1d_only_ea_dtype ,
21
21
)
22
22
from pandas .core .dtypes .missing import na_value_for_dtype
23
23
@@ -105,7 +105,7 @@ def take_nd(
105
105
if not isinstance (arr , np .ndarray ):
106
106
# i.e. ExtensionArray,
107
107
# includes for EA to catch DatetimeArray, TimedeltaArray
108
- if not is_1d_only_ea_obj (arr ):
108
+ if not is_1d_only_ea_dtype (arr . dtype ):
109
109
# i.e. DatetimeArray, TimedeltaArray
110
110
arr = cast ("NDArrayBackedExtensionArray" , arr )
111
111
return arr .take (
Original file line number Diff line number Diff line change @@ -1243,23 +1243,6 @@ def is_bool_dtype(arr_or_dtype) -> bool:
1243
1243
return issubclass (dtype .type , np .bool_ )
1244
1244
1245
1245
1246
- def is_1d_only_ea_obj (obj : Any ) -> bool :
1247
- """
1248
- ExtensionArray that does not support 2D, or more specifically that does
1249
- not use HybridBlock.
1250
- """
1251
- from pandas .core .arrays import (
1252
- DatetimeArray ,
1253
- ExtensionArray ,
1254
- PeriodArray ,
1255
- TimedeltaArray ,
1256
- )
1257
-
1258
- return isinstance (obj , ExtensionArray ) and not isinstance (
1259
- obj , (DatetimeArray , TimedeltaArray , PeriodArray )
1260
- )
1261
-
1262
-
1263
1246
def is_1d_only_ea_dtype (dtype : DtypeObj | None ) -> bool :
1264
1247
"""
1265
1248
Analogue to is_extension_array_dtype but excluding DatetimeTZDtype.
@@ -1676,7 +1659,6 @@ def is_all_strings(value: ArrayLike) -> bool:
1676
1659
"infer_dtype_from_object" ,
1677
1660
"INT64_DTYPE" ,
1678
1661
"is_1d_only_ea_dtype" ,
1679
- "is_1d_only_ea_obj" ,
1680
1662
"is_all_strings" ,
1681
1663
"is_any_real_numeric_dtype" ,
1682
1664
"is_array_like" ,
Original file line number Diff line number Diff line change 56
56
from pandas .core .dtypes .common import (
57
57
ensure_platform_int ,
58
58
is_1d_only_ea_dtype ,
59
- is_1d_only_ea_obj ,
60
59
is_dtype_equal ,
61
60
is_list_like ,
62
61
is_string_dtype ,
@@ -356,7 +355,7 @@ def _split_op_result(self, result: ArrayLike) -> list[Block]:
356
355
# if we get a 2D ExtensionArray, we need to split it into 1D pieces
357
356
nbs = []
358
357
for i , loc in enumerate (self ._mgr_locs ):
359
- if not is_1d_only_ea_obj (result ):
358
+ if not is_1d_only_ea_dtype (result . dtype ):
360
359
vals = result [i : i + 1 ]
361
360
else :
362
361
vals = result [i ]
You can’t perform that action at this time.
0 commit comments