-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: regression when applying groupby aggregation on categorical columns #31359
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 12 commits
7e461a1
1314059
8bcb313
24c3ede
dea38f2
cd9e7ac
e5e912b
d0cddb3
4e1abde
0b917c6
e9cac5d
e03357e
a1df393
8743c47
1e10d71
905b3a5
c5d670b
916d9b2
2208fc2
86a254c
c36d97b
3f8ea8f
a6ad1a2
c7daa46
c4ebfa9
bbad886
a6a498e
2a3f5a2
ceef95e
ed91cc1
9c7af0f
ca35648
1b826bb
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 |
---|---|---|
|
@@ -807,7 +807,10 @@ def _try_cast(self, result, obj, numeric_only: bool = False): | |
dtype = obj.dtype | ||
|
||
if not is_scalar(result): | ||
if is_extension_array_dtype(dtype) and dtype.kind != "M": | ||
if ( | ||
is_extension_array_dtype(dtype) | ||
and dtype.kind != "M" | ||
): | ||
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. up until a moment ago this had a length check; without that check this looks like it isnt actually changing anything 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. in the previous commit, i did add a length check, but i do not feel it was right solution. the issue is 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. so |
||
# The function can return something of any type, so check | ||
# if the type is compatible with the calling EA. | ||
# datetime64tz is handled correctly in agg_series, | ||
|
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.
why is this change necessary?