[
https://issues.apache.org/jira/browse/ARROW-6652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16935106#comment-16935106
]
Joris Van den Bossche commented on ARROW-6652:
----------------------------------------------
This should be an easy fix. It seems that the {{Column.to_pandas}} had a
specific check for this case:
https://github.com/apache/arrow/blob/5f564424c71cef12619522cdde59be5f69b31b68/python/pyarrow/table.pxi#L467-L478
that we can add back to Array.to_pandas
> [Python] to_pandas conversion removes timezone from type
> --------------------------------------------------------
>
> Key: ARROW-6652
> URL: https://issues.apache.org/jira/browse/ARROW-6652
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Reporter: Bryan Cutler
> Priority: Critical
> Fix For: 0.15.0
>
>
> Calling {{to_pandas}} on a {{pyarrow.Array}} with a timezone aware timestamp
> type, removes the timezone in the resulting {{pandas.Series}}.
> {code}
> >>> import pyarrow as pa
> >>> a = pa.array([1], type=pa.timestamp('us', tz='America/Los_Angeles'))
> >>> a.to_pandas()
> 0 1970-01-01 00:00:00.000001
> dtype: datetime64[ns]
> {code}
> Previous behavior from 0.14.1 of converting a {{pyarrow.Column}}
> {{to_pandas}} retained the timezone.
> {code}
> In [4]: import pyarrow as pa
> ...: a = pa.array([1], type=pa.timestamp('us', tz='America/Los_Angeles'))
> ...: c = pa.Column.from_array('ts', a)
> In [5]: c.to_pandas()
>
> Out[5]:
> 0 1969-12-31 16:00:00.000001-08:00
> Name: ts, dtype: datetime64[ns, America/Los_Angeles]
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)