-
Notifications
You must be signed in to change notification settings - Fork 116
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
SNOW-1489371: Implement GroupBy.value_counts #1986
Merged
Merged
Conversation
This file contains 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
sfc-gh-joshi
force-pushed
the
joshi-SNOW-1489371-groupby-value_count
branch
from
July 26, 2024 17:27
52086f6
to
2d23b99
Compare
sfc-gh-joshi
force-pushed
the
joshi-SNOW-1489371-groupby-value_count
branch
2 times, most recently
from
August 8, 2024 23:47
7514121
to
d719298
Compare
sfc-gh-joshi
force-pushed
the
joshi-SNOW-1489371-groupby-value_count
branch
from
August 28, 2024 00:26
d719298
to
bc5962b
Compare
sfc-gh-joshi
changed the title
SNOW-1489371: Implement GroupBy.value_count
SNOW-1489371: Implement GroupBy.value_counts
Aug 28, 2024
sfc-gh-joshi
force-pushed
the
joshi-SNOW-1489371-groupby-value_count
branch
2 times, most recently
from
August 29, 2024 22:23
8a57df9
to
caadf9f
Compare
sfc-gh-azhan
approved these changes
Aug 30, 2024
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.
Great work, Jonathan! This seems like a monstrous task, thank you for having such detailed documentation about it. I left a couple comments and I think it's good to merge after.
sfc-gh-joshi
force-pushed
the
joshi-SNOW-1489371-groupby-value_count
branch
from
August 30, 2024 20:03
1336993
to
e48dfe3
Compare
sfc-gh-vbudati
approved these changes
Aug 30, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1489371
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This PR adds support for GroupBy.value_counts, accepting all parameters except
bin
, which we do not support for DataFrame/Series.value_counts.Upstream modin defaults to pandas for both DataFrameGroupBy/SeriesGroupBy.value_counts, so some of these changes should be eventually upstreamed.
pandas has different behavior than what might be expected from documentation; this PR tries to align with existing behavior as much as possible. This is documented in this pandas issue: pandas-dev/pandas#59307
normalize=True
, pandas sorts by the pre-normalization counts, leading to counterintuitive results. This only matters whengroupby
is called withsort=False
andvalue_counts
withsort=True
. See test cases for an example.groupby
and thevalue_counts
call itself. The behaviors are as follows (copied from query compiler comments):