Naveen Michaud-Agrawal created ARROW-2106:
---------------------------------------------

             Summary: pyarrow.array can't take a pandas Series of python 
datetime objects.
                 Key: ARROW-2106
                 URL: https://issues.apache.org/jira/browse/ARROW-2106
             Project: Apache Arrow
          Issue Type: Bug
    Affects Versions: 0.8.0
            Reporter: Naveen Michaud-Agrawal


> import pyarrow
> from datetime import datetime
> import pandas
> dt = pandas.Series([datetime(2017, 12, 1), datetime(2017, 12, 3), 
> datetime(2017, 12, 15)], dtype=object)
> pyarrow.array(dt, from_pandas=True)

Raises following:

ArrowInvalid: Error inferring Arrow type for Python object array. Got Python 
object of type datetime but can only handle these types: string, bool, float, 
int, date, time, decimal, list, array.

As far as I can tell, the issue seems to be the call to PyDate_CheckExact here 
(instead of using PyDate_Check):

https://github.com/apache/arrow/blob/3098c1411930259070efb571fb350304b18ddc70/cpp/src/arrow/python/numpy_to_arrow.cc#L1005



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to