You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "westonpace (via GitHub)" <gi...@apache.org> on 2023/03/06 22:49:54 UTC

[GitHub] [arrow] westonpace commented on issue #25593: [Python] Array.__str__ shows misleading output for timestamp types with time zone set

westonpace commented on issue #25593:
URL: https://github.com/apache/arrow/issues/25593#issuecomment-1457165812

   One potential workaround is to cast to string.  Though I agree, changing the `__str__` would be nice too:
   
   ```
   >>> now = pd.Timestamp.now(tz=zoneinfo.ZoneInfo('America/New_York'))
   >>> now
   Timestamp('2023-03-06 17:48:12.283474-0500', tz='America/New_York')
   >>> arr = pa.Array.from_pandas(pd.Series([now]))
   >>> import pyarrow.compute as pc
   >>> pc.cast(arr, pa.string())
   <pyarrow.lib.StringArray object at 0x7f7ae2160580>
   [
     "2023-03-06 17:48:12.283474000-0500"
   ]
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org