Allow null values in conversion to datetime object#999
Merged
Conversation
…for valid_time aux coord having NaT values wherever there are holes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #999 +/- ##
===========================================
+ Coverage 81.46% 81.48% +0.01%
===========================================
Files 236 236
Lines 15432 15444 +12
Branches 754 754
===========================================
+ Hits 12572 12584 +12
Misses 2634 2634
Partials 226 226 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
@pawel-wolff, thanks for this fix. As safety measure, I suggest you add tests for these new |
Contributor
Author
|
Will do! |
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.
Description
This PR addresses the following issue:
The above script crashes in
earthkit-data/src/earthkit/data/utils/dates.py
Line 72 in 03ca2ad
AttributeError: 'FloatData' object has no attribute 'to_datetime'. The expected behaviour is to have an xarray Dataset indswithvalid_timeauxiliary coordinate variable having 3 values + one 'NaT'.To this end, the current PR extends the conversion to
datetimeobject implemented inearthkit-data/src/earthkit/data/utils/dates.py
Line 47 in 03ca2ad
Contributor Declaration
By opening this pull request, I affirm the following: