Skip to content
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

Fixed decoding of timestamp by using correct format string #128

Merged
merged 2 commits into from
Apr 25, 2023

Conversation

lpilz
Copy link
Collaborator

@lpilz lpilz commented Apr 4, 2023

Change Summary

Fixed the issue in #127's CI by using the correct format string without milliseconds to decode the timestamps instead of using the format string. For some reason python 3.9 and 3.10 were able to also parse datetime strings without the milliseconds added but 3.8 was not.

Related issue number

#127

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable

@lpilz
Copy link
Collaborator Author

lpilz commented Apr 4, 2023

I don't really get why python 3.9 and 3.10 work when using the less accurate pd.to_datetime("2005-08-28T12:00:00", format="%Y-%m-%dT%H:%M:%S.%f") works but don't work when the more accurate ISO8601 which has milliseconds defined as optional.

@lpilz
Copy link
Collaborator Author

lpilz commented Apr 4, 2023

@jthielen Do we ever have the case that we need to actually take care of milliseconds?

@lpilz lpilz changed the title Fixed decoding of timestamp by using more flexible ISO8601 Fixed decoding of timestamp by using correct format string Apr 5, 2023
@lpilz
Copy link
Collaborator Author

lpilz commented Apr 25, 2023

I'll merge it for now and we'll just have to maybe add another try-fail for milliseconds if we want to support them

@lpilz lpilz merged commit b847b0e into xarray-contrib:main Apr 25, 2023
@lpilz lpilz deleted the fix_date_decoding branch April 25, 2023 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant