TST: tz-aware grouper/map returning tz-naive (GH#57192)#65997
Merged
Conversation
Add regression tests covering DatetimeIndex.map and groupby with a function that strips the tz; the result should be tz-naive rather than re-localized to the original tz. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hamdanal
pushed a commit
to hamdanal/pandas
that referenced
this pull request
Jun 27, 2026
…5997) Co-authored-by: Claude Opus 4.8 (1M context) <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.
closes #57192
Grouping a tz-aware
DatetimeIndexby a function that strips the tz (e.g.ts.normalize().tz_convert(None)) used to give back group keys re-localized to the original tz instead of the tz-naive values the function returned. Same forDatetimeIndex.map.This was a regression introduced by
EA._from_scalars(GH-53089) and already fixed by theEA._cast_pointwise_resultrefactor (GH-62105), which no longer routes theNDArrayBackedmap path through_from_scalars. Adding regression tests at both themap(root cause) and groupby (reported) levels.