Adapt to change in behavior of pandas.Timestamp constructor#10944
Merged
spencerkclark merged 5 commits intopydata:mainfrom Nov 28, 2025
Merged
Adapt to change in behavior of pandas.Timestamp constructor#10944spencerkclark merged 5 commits intopydata:mainfrom
pandas.Timestamp constructor#10944spencerkclark merged 5 commits intopydata:mainfrom
Conversation
spencerkclark
commented
Nov 23, 2025
Member
Author
There was a problem hiding this comment.
The changes here are unrelated to the change in time decoding—here we were merely relying on the previous Timestamp constructor behavior in setting up the tests.
shoyer
approved these changes
Nov 24, 2025
Co-authored-by: Stephan Hoyer <shoyer@google.com>
shoyer
approved these changes
Nov 24, 2025
kmuehlbauer
approved these changes
Nov 28, 2025
Contributor
kmuehlbauer
left a comment
There was a problem hiding this comment.
Thanks @spencerkclark 👍
Member
Author
|
Thanks @shoyer and @kmuehlbauer |
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.
This PR resolves the upstream test failures indicated in #10932 by introducing a function to automatically cast a
pandas.Timestampto the coarsest resolution without changing its value, which we depend on in decoding the reference date of datetime data. Previously theTimestampconstructor would approximately accomplish this for us, but this was changed in pandas-dev/pandas#62801.In some cases the behavior of this function will be different than the previous
Timestampconstructor, since this function does not parse the string for this information. For example, previously theTimestampconstructor would assume that millisecond resolution was needed to represent this time:but strictly speaking only
"s"resolution is needed, which is what this new approach will choose. In a certain way, however, this may ultimately be more consistent with how we infer the resolution of the data values themselves. I did not add a what's new entry since this is somewhat of an internal change, but I can add one if we feel the change in behavior of this edge case is worth noting.cc: @kmuehlbauer