Skip to content

Conversation

rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Aug 26, 2025

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

#57971 enforced this deprecation in all cases except axis=1 with EAs as that used the groupby implementation which did not get deprecated at that time. We've since decided it is better to enforce this behavior change across the board (#62026), so we should also do the axis=1 with EA case.

The whatsnew note:

Enforced deprecation of argmin, argmax, idxmin, and idxmax returning a result when skipna=False and an NA value is encountered or all values are NA values; these operations will now raise in such cases (:issue:33941, :issue:51276)

still covers this, so no new note is needed.

@rhshadrach rhshadrach added Clean ExtensionArray Extending pandas with custom dtypes or arrays. Reduction Operations sum, mean, min, max, etc. labels Aug 26, 2025
Comment on lines -5706 to -5709
raise ValueError(
f"{type(self).__name__}.{how} with skipna=False encountered an NA "
f"value."
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing the error message here to not identify the type of object that is raising the error. This should be apparent to the user already. If we include the type, then we'll need to catch and rethrow in the DataFrame case with axis=1 and EAs.

@rhshadrach rhshadrach added this to the 3.0 milestone Aug 26, 2025
@mroeschke mroeschke merged commit 4088ec2 into pandas-dev:main Aug 27, 2025
48 checks passed
@mroeschke
Copy link
Member

Thanks @rhshadrach

@rhshadrach rhshadrach deleted the cln_enforce_idxmin_depr branch August 27, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean ExtensionArray Extending pandas with custom dtypes or arrays. Reduction Operations sum, mean, min, max, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants