-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fix time encoding to use int64 and "nanoseconds since 1970-01-01 00:00:00Z" #1299
Fix time encoding to use int64 and "nanoseconds since 1970-01-01 00:00:00Z" #1299
Conversation
_encode_dataarray
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1299 +/- ##
==========================================
- Coverage 83.52% 74.57% -8.95%
==========================================
Files 64 23 -41
Lines 5686 3182 -2504
==========================================
- Hits 4749 2373 -2376
+ Misses 937 809 -128
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Explanation of the current warning (from slack conversation)Here's the current order of events in the code that is causing this warning: (https://github.com/pydata/xarray/blob/1d43672574332615f225089d69f95a9f8d81d912/xarray/coding/times.py#L723C1-L803C32):
Now, I am not quite sure at this point why Perhaps this is an issue I bring up in On our own end, do you think adding a warning in the logger for this would be a good idea? That way those users that have logger verbose turned on can still get the message. |
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.
@ctuguinay : Looks great! I am glad we got this resolved after much digging and trial and error!
I only have one comment: What do you think of changing the function name _encode_dataarray
to _encode_time_dataarray
? Since it is only used for set_time_encodings
and the content does not make sense for other types of dataarray?
Otherwise I think this is good to go.
_encode_dataarray
@leewujung Made that change. This should be ready to merge now |
This PR addresses the not faithful time serialization warning from issue #1290.