Skip to content

[Python] pa.Array.from_pandas converts empty timestamp[s][pyarrow, UTC] pandas Series to ChunkedArray, not TimestampArray #40538

Open
@Wainberg

Description

@Wainberg

Describe the bug, including details regarding any error messages, version, and platform.

>>> pa.Array.from_pandas(pd.Series([], dtype=pd.ArrowDtype(pa.timestamp('s'))))  # correct
<pyarrow.lib.TimestampArray object at 0x7fb665f77fa0>
[]
>>> pa.Array.from_pandas(pd.Series([], dtype=pd.ArrowDtype(pa.timestamp('s'))).dt.tz_localize('UTC'))  # incorrect
<pyarrow.lib.ChunkedArray object at 0x7fb665fd8680>
[

]

Same issue with pa.array() instead of pa.Array.from_pandas().

Component(s)

Python

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