Skip to content

Replace _has_complex_internals #29227 #29237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/core/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
is_list_like,
is_sequence,
)
from pandas.core.dtypes.generic import ABCSeries
from pandas.core.dtypes.generic import ABCMultiIndex, ABCSeries

if TYPE_CHECKING:
from pandas import DataFrame, Series, Index
Expand Down Expand Up @@ -281,7 +281,7 @@ def apply_standard(self):
and not self.dtypes.apply(is_extension_array_dtype).any()
# Disallow complex_internals since libreduction shortcut
# cannot handle MultiIndex
and not self.agg_axis._has_complex_internals
and not isinstance(self.agg_axis, ABCMultiIndex)
):

values = self.values
Expand Down
5 changes: 0 additions & 5 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4086,11 +4086,6 @@ def _assert_can_do_op(self, value):
msg = "'value' must be a scalar, passed: {0}"
raise TypeError(msg.format(type(value).__name__))

@property
def _has_complex_internals(self):
# to disable groupby tricks in MultiIndex
return False

def _is_memory_usage_qualified(self):
"""
Return a boolean if we need a qualified .info display.
Expand Down
5 changes: 0 additions & 5 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,11 +1396,6 @@ def values(self):
self._tuples = lib.fast_zip(values)
return self._tuples

@property
def _has_complex_internals(self):
# to disable groupby tricks
return True

@cache_readonly
def is_monotonic_increasing(self):
"""
Expand Down