You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2017/11/18 02:14:00 UTC

[jira] [Commented] (ARROW-1628) [Python] Incorrect serialization of numpy datetimes.

    [ https://issues.apache.org/jira/browse/ARROW-1628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16257876#comment-16257876 ] 

Wes McKinney commented on ARROW-1628:
-------------------------------------

Removing this from 0.8.0 unless it's urgent. There's some annoying things here, because the datetime64 objects can have different metadata:

{code}
In [4]: arr1 = np.array([datetime(2000, 1, 1)], dtype='datetime64')

In [5]: arr1
Out[5]: array(['2000-01-01'], dtype='datetime64[D]')

In [6]: arr1[0]
Out[6]: numpy.datetime64('2000-01-01')

In [7]: arr1[0].dtype
Out[7]: dtype('<M8[D]')

In [8]: arr1 = np.array([datetime(2000, 1, 1)], dtype='datetime64[ns]')

In [9]: arr1[0].dtype
Out[9]: dtype('<M8[ns]')
{code}

> [Python] Incorrect serialization of numpy datetimes.
> ----------------------------------------------------
>
>                 Key: ARROW-1628
>                 URL: https://issues.apache.org/jira/browse/ARROW-1628
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Robert Nishihara
>             Fix For: 0.9.0
>
>
> See https://github.com/ray-project/ray/issues/1041.
> The issue can be reproduced as follows.
> {code}
> import pyarrow as pa
> import numpy as np
> t = np.datetime64(datetime.datetime.now())
> print(type(t), t)  # <class 'numpy.datetime64'> 2017-09-30T09:50:46.089952
> t_new = pa.deserialize(pa.serialize(t).to_buffer())
> print(type(t_new), t_new)  # <class 'int'> 0
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)