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

Fix test for new group keys behavior for Pandas 2 #28566

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

caneff
Copy link
Contributor

@caneff caneff commented Sep 20, 2023

In Pandas 2, groupby().apply() will append group keys to an index that already has them in cases where the apply is really a transform (the resulting index is same as the incoming one). This is a change from Pandas 1.5.

When running the original test with Pandas 1.5, we get the following warning:

To preserve the previous behavior, use

	>>> .groupby(..., group_keys=False)

To adopt the future behavior and silence this warning, use 

	>>> .groupby(..., group_keys=True)
  df.groupby(['provider']).apply(lambda x: x)

So I set group_keys to False to retain the 1.5 behavior.

@caneff
Copy link
Contributor Author

caneff commented Sep 20, 2023

R: @tvalentyn

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #28566 (99f375f) into master (a722740) will increase coverage by 0.00%.
Report is 44 commits behind head on master.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #28566   +/-   ##
=======================================
  Coverage   72.23%   72.23%           
=======================================
  Files         684      684           
  Lines      100883   100977   +94     
=======================================
+ Hits        72869    72945   +76     
- Misses      26435    26453   +18     
  Partials     1579     1579           
Flag Coverage Δ
python 82.82% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 17 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tvalentyn tvalentyn merged commit 1d94f5f into apache:master Sep 20, 2023
75 of 76 checks passed
@caneff caneff deleted the proxy_final branch September 21, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants