You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2020/12/16 08:44:00 UTC

[jira] [Commented] (ARROW-10935) [Python] pa.array() doesn't support pa.lib.TimestampScalar objects

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

Joris Van den Bossche commented on ARROW-10935:
-----------------------------------------------

Indeed, our own scalars are at the moment not supported. See ARROW-5295 for a general issue about this (so will close this issue as a duplicate of that).

bq. This bug completely blocks my specific use case

Can you explain a bit how it completely blocks you? I understand it can be annoying, but normally you should always be able to convert to pyarrow scalars to python objects before passing them to {{pa.array([..])}} ?

> [Python] pa.array() doesn't support pa.lib.TimestampScalar objects
> ------------------------------------------------------------------
>
>                 Key: ARROW-10935
>                 URL: https://issues.apache.org/jira/browse/ARROW-10935
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 2.0.0
>         Environment: Windows 10, Python 3.7.4, PyArrow 2.0.0
>            Reporter: slatebit
>            Priority: Blocker
>
> I encountered this edge case bug in PyArrow v2.0.0. For some reason, pa.array() does not know how to support pa.lib.TimestampScalar objects. This bug completely blocks my specific use case, although I do recognize that this edge case seems kind of wonky. Nonetheless, I don't see any reason why PyArrow would not understand one of it's own object types.
>  
> Stacktrace:
> {code:java}
> ArrowInvalid: Could not convert 2020-11-04 22:50:16.276892 with type pyarrow.lib.TimestampScalar: did not recognize Python value type when inferring an Arrow data type
> {code}
>  
> Reproducible Code:
> {code:java}
> import pandas as pd
> import pyarrow as pa
> pa.array([pa.scalar(pd.to_datetime('2020-11-04 22:50:16.276892000'))])
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)