Skip to content

Address pandas warning about deprecated DataFrameGroupBy.apply default #7235

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
merged 2 commits into from
Apr 7, 2025

Conversation

pavoljuhas
Copy link
Collaborator

@pavoljuhas pavoljuhas commented Apr 7, 2025

The current default is to pass grouping columns to the apply function,
which in our case does not use them at all. Here we exclude them with
include_groups=False adopting the new behavior.

This fixes DataFramgeGroupBy.apply warning in

$ check/pytest -Werror:DataFrameGroupBy cirq-core/cirq/experiments
...
FAILED cirq-core/cirq/experiments/xeb_fitting_test.py::test_parallel_full_workflow[True] - DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated,...

The current default is to pass grouping columns to the apply function,
which in our case does not use them at all.  Here we exclude them with
`include_groups=False` adopting the new behavior.

Adding temporary check that the new output is the same.
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.65%. Comparing base (0a326d0) to head (580d153).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7235      +/-   ##
==========================================
- Coverage   98.65%   98.65%   -0.01%     
==========================================
  Files        1106     1106              
  Lines       95992    95992              
==========================================
- Hits        94703    94702       -1     
- Misses       1289     1290       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pavoljuhas pavoljuhas marked this pull request as ready for review April 7, 2025 22:45
@pavoljuhas pavoljuhas requested review from mrwojtek, vtomole and a team as code owners April 7, 2025 22:45
@pavoljuhas pavoljuhas requested review from fdmalone and mhucka April 7, 2025 22:45
Copy link
Contributor

@mhucka mhucka left a comment

Choose a reason for hiding this comment

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

LGTM

@pavoljuhas pavoljuhas enabled auto-merge April 7, 2025 22:49
@pavoljuhas pavoljuhas added this pull request to the merge queue Apr 7, 2025
Merged via the queue into quantumlib:main with commit 0684419 Apr 7, 2025
38 checks passed
@pavoljuhas pavoljuhas deleted the pandas-deprecation-warnings branch April 7, 2025 23:51
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
quantumlib#7235)

* Address pandas warning about deprecated DataFrameGroupBy.apply default

The current default is to pass grouping columns to the apply function,
which in our case does not use them at all.  Here we exclude them with
`include_groups=False` adopting the new behavior.

Adding temporary check that the new output is the same.

* Clean up temporary assertion (all tests passed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants