You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Jonathan Keane (Jira)" <ji...@apache.org> on 2022/01/25 15:01:00 UTC
[jira] [Commented] (ARROW-14567) [C++][Python][R] PrettyPrint ignores timezone
[ https://issues.apache.org/jira/browse/ARROW-14567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17481874#comment-17481874 ]
Jonathan Keane commented on ARROW-14567:
----------------------------------------
Agreed that at the very least falling back to a timestamp with Z is good (e.g. when we can't find the timezone database). But IMO the _least confusing_ to users would be to default to localized.
Separately from the default, we should _also_ indicate in some way that though that the type _does_ include a (non-UTC) timezone. If I only saw a string of timestamps like below (+ Z), I would assume the array was set to UTC (and try casting it to a different TZ, and be confused/annoyed that it 'didn't seem to work')
{code}
arr <- Array$create(ts)
arr
#> Array
#> <timestamp[us]> <------ maybe add timezone information here?
#> [
#> 2020-01-01 09:00:00.000000,
#> 2020-01-01 10:00:00.000000,
#> 2020-01-01 11:00:00.000000,
#> 2020-01-01 12:00:00.000000,
#> 2020-01-01 13:00:00.000000,
#> 2020-01-01 14:00:00.000000,
#> 2020-01-01 15:00:00.000000,
#> 2020-01-01 16:00:00.000000,
#> 2020-01-01 17:00:00.000000,
#> 2020-01-01 18:00:00.000000
#> ]
{code}
> [C++][Python][R] PrettyPrint ignores timezone
> ---------------------------------------------
>
> Key: ARROW-14567
> URL: https://issues.apache.org/jira/browse/ARROW-14567
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++, Python, R
> Reporter: Alenka Frim
> Priority: Major
>
> When printing TimestampArray in pyarrow the timezone information is ignored by PrettyPrint (__str__ calls to_string() in array.pxi).
> {code:python}
> import pyarrow as pa
> a = pa.array([0], pa.timestamp('s', tz='+02:00'))
> print(a) # representation not correct?
> # <pyarrow.lib.TimestampArray object at 0x7f834c7cb9a8>
> # [
> # 1970-01-01 00:00:00
> # ]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)