-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Merged
TomAugspurger
merged 33 commits into
pandas-dev:master
from
charlesdong1991:fix_issue_31256
Jan 29, 2020
Merged
Changes from 24 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
7e461a1
remove \n from docstring
charlesdong1991 1314059
fix conflicts
charlesdong1991 8bcb313
Merge remote-tracking branch 'upstream/master'
charlesdong1991 24c3ede
Merge remote-tracking branch 'upstream/master'
charlesdong1991 dea38f2
fix issue 17038
charlesdong1991 cd9e7ac
revert change
charlesdong1991 e5e912b
revert change
charlesdong1991 d0cddb3
Merge remote-tracking branch 'upstream/master' into fix_issue_31256
charlesdong1991 4e1abde
try fix 31256
charlesdong1991 0b917c6
pep8
charlesdong1991 e9cac5d
fix test
charlesdong1991 e03357e
fix
charlesdong1991 a1df393
fix up tests
charlesdong1991 8743c47
preserve order
charlesdong1991 1e10d71
add comment
charlesdong1991 905b3a5
better test
charlesdong1991 c5d670b
fixup
charlesdong1991 916d9b2
remove blank line
charlesdong1991 2208fc2
fix test
charlesdong1991 86a254c
style
charlesdong1991 c36d97b
linting
charlesdong1991 3f8ea8f
wip
TomAugspurger a6ad1a2
alternative
TomAugspurger c7daa46
Merge remote-tracking branch 'upstream/master' into fix_issue_31256
TomAugspurger c4ebfa9
Fixups
TomAugspurger bbad886
revert extranesou
TomAugspurger a6a498e
non-numeric
TomAugspurger 2a3f5a2
xfailing test
TomAugspurger ceef95e
release note
TomAugspurger ed91cc1
fixup
TomAugspurger 9c7af0f
fixup
TomAugspurger ca35648
fixup
TomAugspurger 1b826bb
fixup
TomAugspurger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -813,9 +813,10 @@ def _try_cast(self, result, obj, numeric_only: bool = False): | |
# datetime64tz is handled correctly in agg_series, | ||
# so is excluded here. | ||
|
||
# return the same type (Series) as our caller | ||
cls = dtype.construct_array_type() | ||
result = try_cast_to_ea(cls, result, dtype=dtype) | ||
if len(result) and isinstance(result[0], dtype.type): | ||
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. @charlesdong1991 it looks like this change caused the regression in #32194 |
||
cls = dtype.construct_array_type() | ||
result = try_cast_to_ea(cls, result, dtype=dtype) | ||
|
||
elif numeric_only and is_numeric_dtype(dtype) or not numeric_only: | ||
result = maybe_downcast_to_dtype(result, dtype) | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.