-
-
Notifications
You must be signed in to change notification settings - Fork 19k
Prevent Unlimited Agg Recursion with Duplicate Col Names #21066
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
Changes from 7 commits
11703aa
ee78264
aa781ad
254af5f
88fbd09
2d4cf40
f0135e8
e88eb9b
4a24f73
c0dc3f4
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 |
---|---|---|
|
@@ -5731,7 +5731,12 @@ def diff(self, periods=1, axis=0): | |
# ---------------------------------------------------------------------- | ||
# Function application | ||
|
||
def _gotitem(self, key, ndim, subset=None): | ||
def _gotitem(self, | ||
key, # type: Union[str, List[str]] | ||
ndim, # type: int | ||
subset=None # type: Union[Series, DataFrame, None] | ||
): | ||
# type: (...) -> Union[Series, DataFrame] | ||
""" | ||
sub-classes to define | ||
return a sliced object | ||
|
@@ -5746,9 +5751,11 @@ def _gotitem(self, key, ndim, subset=None): | |
""" | ||
if subset is None: | ||
subset = self | ||
elif subset.ndim == 1: | ||
|
||
subset = self._constructor(subset) | ||
|
||
# TODO: _shallow_copy(subset)? | ||
return self[key] | ||
return subset[key] | ||
|
||
_agg_doc = dedent(""" | ||
The aggregation operations are always performed over an axis, either the | ||
|
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.
I realize we don't have an overall strategy for annotations just yet but I had to think through this as I was debugging anyway, so figured I'd put here explicitly for when we turn this on
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.
ok!