Fix FutureWarning: pass include_groups=False to groupby().apply()#182
Open
BelixRogner wants to merge 1 commit intocrowdcent:masterfrom
Open
Fix FutureWarning: pass include_groups=False to groupby().apply()#182BelixRogner wants to merge 1 commit intocrowdcent:masterfrom
BelixRogner wants to merge 1 commit intocrowdcent:masterfrom
Conversation
Starting with pandas 2.2, groupby().apply() emits a FutureWarning when the grouping columns are included in the passed DataFrame. Add include_groups=False to all three call sites (two in evaluation.py, one in postprocessing.py) to silence the warning and prepare for pandas 3.0 where the default will change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
include_groups=Falseto allgroupby().apply()calls to fix theFutureWarningintroduced in pandas 2.2numerblox/evaluation.py(lines 148, 209) and one innumerblox/postprocessing.py(line 186)Details
Starting with pandas 2.2,
groupby().apply()emits aFutureWarningwhen the grouping columns are included in the DataFrame passed to the applied function. Theinclude_groups=Falseparameter explicitly opts into the future behavior, silencing the warning without changing functionality since the lambdas already select specific columns.🤖 Generated with Claude Code