-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REGR: Prevent indexes that aren't directly backed by numpy from entering libreduction code paths #31238
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
REGR: Prevent indexes that aren't directly backed by numpy from entering libreduction code paths #31238
Changes from 2 commits
dea76c1
ed3a9a3
2efd22b
1018ca9
cc400cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4099,6 +4099,14 @@ def _assert_can_do_op(self, value): | |
if not is_scalar(value): | ||
raise TypeError(f"'value' must be a scalar, passed: {type(value).__name__}") | ||
|
||
@property | ||
def _has_complex_internals(self): | ||
""" | ||
Indicates if an index is not directly backed by a numpy array | ||
""" | ||
# used to disable groupby tricks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "tricks" -> "going through libreduction fastpath which would ..."? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copied that from the original implementation but agree it's not very helpful. Updated to something that's more informative. |
||
return False | ||
|
||
def _is_memory_usage_qualified(self) -> bool: | ||
""" | ||
Return a boolean if we need a qualified .info display. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now excludes
PeriodIndex
, which previously worked fine since.values
converted to a numpy array. It looks more performant to excludePeriodIndex
though, since we avoid the conversion to numpy: