[
https://issues.apache.org/jira/browse/ARROW-2706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17659732#comment-17659732
]
Rok Mihevc commented on ARROW-2706:
-----------------------------------
This issue has been migrated to [issue
#15732|https://github.com/apache/arrow/issues/15732] on GitHub. Please see the
[migration documentation|https://github.com/apache/arrow/issues/14542] for
further details.
> [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
(v8.20.10#820010)