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 2018/06/13 18:50:00 UTC
[jira] [Closed] (ARROW-2706) [Python] pandas Timestamp not
supported in ListArray
[ https://issues.apache.org/jira/browse/ARROW-2706?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wes McKinney closed ARROW-2706.
-------------------------------
Resolution: Duplicate
Duplicate of ARROW-2130
> [Python] pandas Timestamp not supported in ListArray
> ----------------------------------------------------
>
> Key: ARROW-2706
> URL: https://issues.apache.org/jira/browse/ARROW-2706
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 0.9.0
> Reporter: Thomas Buhrmann
> Priority: Major
>
> It seems pandas Timestamps are supported in some places but not others. Specifically, they work in primitive Arrays but not ListArrays:
> {code:java}
> import pyarrow
> from datetime import datetime
> ts = [pd.Timestamp(2017, 1, 1, 12), pd.Timestamp(2018, 1, 1, 12)]
> dt = [datetime(2017, 1, 1, 12), datetime(2018, 1, 1, 12)]
> pyarrow.Table.from_pandas(pd.DataFrame(dict(dates=dt))) # OK :)
> pyarrow.Table.from_pandas(pd.DataFrame(dict(dates=[dt, dt]))) # OK :)
> pyarrow.Table.from_pandas(pd.DataFrame(dict(dates=ts))) # OK :)
> pyarrow.Table.from_pandas(pd.DataFrame(dict(dates=[ts, ts]))) # Fail :(
> {code}
> The above code results in:
> {noformat}
> ArrowInvalid: Error inferring Arrow data type for collection of Python objects. Got Python object of type Timestamp but can only handle these types: bool, float, integer, date, datetime, bytes, unicode, decimal{noformat}
>
> I guess this should be supported?
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)