-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Preserve formatting of reference time units under pandas 2.0.0 #7441
Conversation
Changes in pandas 2.0.0 interfere with the way we expect some times to be formatted.
I think this is a bug in In any case, |
Thanks @keewis.
I suspect this may be related to the comment here.
Though indeed the
I can report that to pandas. It's not necessarily surprising considering that it previously was not possible to write |
Issue reported here: pandas-dev/pandas#50867. Thanks again for noting that @keewis. I was too narrowly focused on fixing this in xarray. We may still want to be careful about non-nanosecond-precision |
Co-authored-by: Justus Magin <[email protected]>
for more information, see https://pre-commit.ci
Changes in pandas 2.0.0 interfere with the way we expect some times to be formatted.
Co-authored-by: Justus Magin <[email protected]>
for more information, see https://pre-commit.ci
…rray into fix-time-format
Thanks @keewis--great suggestion--I think this should be ready for review now too! |
Hmm I guess I should have run the tests before saying anything. We could probably work around the |
…rray into fix-time-format
Still mulling this over a bit, but one other thing that occurs to me is that if we go with a |
Pandas is expecting to release v2 in two weeks (pandas-dev/pandas#46776 (comment)). But we are still incompatible with their main branch: - #7441 - #7420 This PR pins pandas to `<2`
* Pin pandas < 2 Pandas is expecting to release v2 in two weeks (pandas-dev/pandas#46776 (comment)). But we are still incompatible with their main branch: - #7441 - #7420 This PR pins pandas to `<2` * modify requirements.txt * Update requirements
Co-authored-by: Justus Magin <[email protected]>
…rray into fix-time-format
Thanks @keewis for fixing this upstream (pandas-dev/pandas#52220)! |
Co-authored-by: Spencer Clark <[email protected]>
the commit with my fix seems to have passed all CI (although using |
Thanks for cleaning up the merge error I must have introduced; I agree this should be ready to go. |
As suggested by @keewis, to preserve existing behavior in xarray, this PR forces any object passed to
format_timestamp
to be converted to a string usingstrftime
with a constant format. This addresses the failing tests related to the units encoding in #7420.whats-new.rst