[
https://issues.apache.org/jira/browse/ARROW-10511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17227585#comment-17227585
]
Neal Richardson edited comment on ARROW-10511 at 11/6/20, 7:21 PM:
-------------------------------------------------------------------
I tested this on the latest nightly wheel and reproduced the error. If you
remove {{tz="utc"}}, it does not error. (Not proposing that as a solution, just
trying to provide more information on where the error is being triggered.)
was (Author: npr):
I tested this on the latest nightly wheel and reproduced the error. If you
remove {{tz="utc"}}, it does not error.
> [Python] Timezone error in Table.to_pandas()
> --------------------------------------------
>
> Key: ARROW-10511
> URL: https://issues.apache.org/jira/browse/ARROW-10511
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Affects Versions: 2.0.0
> Environment: Ubuntu 20.04, Python 3.8.6, Pandas 1.1.4
> Reporter: Karl Dunkle Werner
> Priority: Minor
>
> We're having an issue with timezones in the Table {{to_pandas}} methods. See
> example below.
> {code:python}
> import pyarrow as pa
> import pandas as pd
> print(pa.__version__)
> # 2.0.0
> df = pd.DataFrame({"time": pd.to_datetime([0, 0])})
> time_field = pa.field("time",type=pa.timestamp("ms", tz="utc"),
> nullable=False)
> schema = pa.schema([time_field])
> tab = pa.Table.from_pandas(df, schema)
> tab.to_pandas()
> # File ".../pandas_compat.py", line 777, in table_to_blockmanager
> # table = _add_any_metadata(table, pandas_metadata)
> # File ".../pandas_compat.py", line 1184, in _add_any_metadata
> # tz = col_meta['metadata']['timezone']
> # TypeError: 'NoneType' object is not subscriptable
> {code}
> Related issues:
> https://issues.apache.org/jira/browse/ARROW-9223
> https://issues.apache.org/jira/browse/ARROW-9528
> https://github.com/catalyst-cooperative/pudl/issues/705
--
This message was sent by Atlassian Jira
(v8.3.4#803005)