Skip to content

[Python] pa.array() doesn't support pa.lib.TimestampScalar objects #26862

@asfimport

Description

@asfimport

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:

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

 

Reproducible Code:

import pandas as pd
import pyarrow as pa

pa.array([pa.scalar(pd.to_datetime('2020-11-04 22:50:16.276892000'))])

Environment: Windows 10, Python 3.7.4, PyArrow 2.0.0
Reporter: slatebit

Related issues:

Note: This issue was originally created as ARROW-10935. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions