Joris Van den Bossche created ARROW-6305:
--------------------------------------------

             Summary: [Python] scalar pd.NaT incorrectly parsed in conversion 
from Python
                 Key: ARROW-6305
                 URL: https://issues.apache.org/jira/browse/ARROW-6305
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
            Reporter: Joris Van den Bossche


When converting from scalar values, using {{pd.NaT}} (the missing value 
indicator that pandas uses for datetime64 data) results in an incorrect 
timestamp:

{code}
In [6]: pa.array([pd.Timestamp("2012-01-01"), pd.NaT]) 
Out[6]: 
<pyarrow.lib.TimestampArray object at 0x7f46c8368780>
[
  2012-01-01 00:00:00.000000,
  0001-01-01 00:00:00.000000
]
{code}

where {{pd.NaT}} is converted to "0001-01-01", which is strange, as that does 
not even correspond with the integer value of pd.NaT. 

Numpy's version ({{np.datetime64('NaT')}}) is correctly handled. Which also 
means that a pandas Series holding pd.NaT is handled correctly (as when 
converting to numpy it is using numpy's NaT).

Related to ARROW-842.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to