Skip to content

Conversation

@spencerkclark
Copy link
Member

This PR resolves the upstream test failures indicated in #10932 by introducing a function to automatically cast a pandas.Timestamp to the coarsest resolution without changing its value, which we depend on in decoding the reference date of datetime data. Previously the Timestamp constructor 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 Timestamp constructor, since this function does not parse the string for this information. For example, previously the Timestamp constructor would assume that millisecond resolution was needed to represent this time:

>>> pd.Timestamp("2000-01-01T00:00:00.00").unit
'ms'

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

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

@spencerkclark spencerkclark added the run-upstream Run upstream CI label Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚠️ Nightly upstream-dev CI failed ⚠️

2 participants