Skip to content
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

TST: Add test groupby transform no column #56935

Conversation

DevpriyaDave
Copy link

@rhshadrach rhshadrach added Groupby Needs Tests Unit test(s) needed to prevent regressions labels Jan 18, 2024
@rhshadrach rhshadrach changed the title Add test groupby transform no column TST: Add test groupby transform no column Jan 18, 2024
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

gb = df.groupby(pd.Series(["a"]), as_index=False)
msg = "A grouping was used that is not in the columns of the DataFrame"
with tm.assert_produces_warning(FutureWarning, match=msg):
result = gb.sum()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the linked issue, you want to be using .transform("sum") here.

@rhshadrach rhshadrach added the Transformations e.g. cumsum, diff, rank label Jan 18, 2024
@DevpriyaDave
Copy link
Author

Thanks for the PR!

Thanks for your review and appreciate you updating the PR title, I will make a note of the format for next time.

Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Feb 18, 2024
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Needs Tests Unit test(s) needed to prevent regressions Stale Transformations e.g. cumsum, diff, rank
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: groupby-transform produces NaN for series keys with as_index=False
3 participants