-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Groupby.agg with reduction function with tz aware data #25308
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
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
46943e0
BUG: Groupby.agg cannot reduce with tz aware data
724a69e
Handle output always as UTC
54a5b7c
Merge remote-tracking branch 'upstream/master' into timezone_agg
0d1eb55
Add whatsnew
b4913dc
isort and add another fixed groupby.first/last issue
2aa3a2c
Merge remote-tracking branch 'upstream/master' into timezone_agg
18198f4
Merge remote-tracking branch 'upstream/master' into timezone_agg
c970848
Merge remote-tracking branch 'upstream/master' into timezone_agg
da26b7b
bring condition at a higher level
1295d4f
Merge remote-tracking branch 'upstream/master' into timezone_agg
60adcf0
Add try for _try_cast
e9ac6e8
Merge remote-tracking branch 'upstream/master' into timezone_agg
619f071
Merge remote-tracking branch 'upstream/master' into timezone_agg
206303a
Add comments
4ac569c
Merge remote-tracking branch 'upstream/master' into timezone_agg
1339a45
Merge remote-tracking branch 'upstream/master' into timezone_agg
0c0b43a
Don't pass the utc_dtype explicitly
5bf07a9
Remove unused import
95a48d6
Use string dtype instead
7feb4a7
Merge remote-tracking branch 'upstream/master' into timezone_agg
fd1a2ec
Merge remote-tracking branch 'upstream/master' into timezone_agg
3cfe961
Merge remote-tracking branch 'upstream/master' into timezone_agg
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you just pass
dtype='UTC'
instead of creating the actual dtype? (as that we rarely do for timezones)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried and passing
dtype='UTC'
didn't work here. (IMO it's more explicit too that we're passing a dtype object here)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why doesn’t this work? that is very odd
we rarely actually pass the dtype object anywhere else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you actually need to construct as naive then localize? (these should be the same though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests were failing; possibly the order of operations are different in
_from_sequence
.Using
tz_localize('UTC').tz_convert(dtype.tz)
worked though