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

Make sure datetime object arrays are converted to datetime64 #2513

Merged
merged 3 commits into from
Oct 27, 2018

Conversation

dcherian
Copy link
Contributor

@pep8speaks
Copy link

Hello @dcherian! Thanks for submitting the PR.

Copy link
Member

@spencerkclark spencerkclark left a comment

Choose a reason for hiding this comment

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

Good catch! While you're at it, maybe for completeness you could add a test for converting an array of datetime.timedelta objects to np.timedelta64? Otherwise, pending a bug fix note addition to the what's new page, this looks good to me.

@@ -95,7 +95,7 @@ def as_variable(obj, name=None):
'cannot set variable %r with %r-dimensional data '
'without explicit dimension names. Pass a tuple of '
'(dims, data) instead.' % (name, data.ndim))
obj = Variable(name, obj, fastpath=True)
obj = Variable(name, data, fastpath=True)
Copy link
Member

Choose a reason for hiding this comment

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

good catch! I love it when fixes are this simple :)

@dcherian dcherian merged commit 2f0096c into pydata:master Oct 27, 2018
@dcherian dcherian deleted the fix/2512 branch October 27, 2018 16:34
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.

to_netcdf() fails because of datetime encoding
4 participants