Skip to content

Commit e027d8d

Browse files
AivengoeMateusz Górski
authored and
Mateusz Górski
committed
Replace _has_complex_internals pandas-dev#29227 (pandas-dev#29237)
1 parent fe1c726 commit e027d8d

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

pandas/core/apply.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
is_list_like,
1414
is_sequence,
1515
)
16-
from pandas.core.dtypes.generic import ABCSeries
16+
from pandas.core.dtypes.generic import ABCMultiIndex, ABCSeries
1717

1818
if TYPE_CHECKING:
1919
from pandas import DataFrame, Series, Index
@@ -281,7 +281,7 @@ def apply_standard(self):
281281
and not self.dtypes.apply(is_extension_array_dtype).any()
282282
# Disallow complex_internals since libreduction shortcut
283283
# cannot handle MultiIndex
284-
and not self.agg_axis._has_complex_internals
284+
and not isinstance(self.agg_axis, ABCMultiIndex)
285285
):
286286

287287
values = self.values

pandas/core/indexes/base.py

-5
Original file line numberDiff line numberDiff line change
@@ -4086,11 +4086,6 @@ def _assert_can_do_op(self, value):
40864086
msg = "'value' must be a scalar, passed: {0}"
40874087
raise TypeError(msg.format(type(value).__name__))
40884088

4089-
@property
4090-
def _has_complex_internals(self):
4091-
# to disable groupby tricks in MultiIndex
4092-
return False
4093-
40944089
def _is_memory_usage_qualified(self):
40954090
"""
40964091
Return a boolean if we need a qualified .info display.

pandas/core/indexes/multi.py

-5
Original file line numberDiff line numberDiff line change
@@ -1396,11 +1396,6 @@ def values(self):
13961396
self._tuples = lib.fast_zip(values)
13971397
return self._tuples
13981398

1399-
@property
1400-
def _has_complex_internals(self):
1401-
# to disable groupby tricks
1402-
return True
1403-
14041399
@cache_readonly
14051400
def is_monotonic_increasing(self):
14061401
"""

0 commit comments

Comments
 (0)