GH1671 Improve testing for Transformation/Reduction methods on Groupby#1672
Open
loicdiridollou wants to merge 1 commit intopandas-dev:mainfrom
Open
GH1671 Improve testing for Transformation/Reduction methods on Groupby#1672loicdiridollou wants to merge 1 commit intopandas-dev:mainfrom
loicdiridollou wants to merge 1 commit intopandas-dev:mainfrom
Conversation
cmp0xff
requested changes
Feb 13, 2026
Comment on lines
+937
to
+938
| with pytest_warns_bounded(Pandas4Warning, "corrwith is deprecated", lower="2.99"): | ||
| check(assert_type(GB_DF.transform("corrwith", other=DF), DataFrame), DataFrame) |
Contributor
There was a problem hiding this comment.
We don't support 2.x anymore, do we?
Member
Author
There was a problem hiding this comment.
in pytest_warns_bounded the check for version is strict so if you put 3.0 it will not trigger for the 3.0 version, that way I am forced to stick to 2.99. (we had the issue in a different PR).
|
|
||
| def test_frame_groupby_transform_reduction_kernels() -> None: | ||
| """Test DataFrameGroupBy.transform with ReductionKernelType literals.""" | ||
| check(assert_type(GB_DF.transform("all"), DataFrame), DataFrame) |
Contributor
There was a problem hiding this comment.
I think for DataFrame.transform, all str's are accepted by the stubs at the moment. Shall we switch to a Literal and also add one or two negative tests in TYPE_CHECKING_INVALID_USAGE?
Member
Author
There was a problem hiding this comment.
Happy to make the switch, I was just worried there are some functions not in the list and we would break for the user. What do you think? Should we take the risk?
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.
ReductionKernelType#1671assert_type()to assert the type of any return value)AGENTS.md.