Wainberg commented on issue #40122:
URL: https://github.com/apache/arrow/issues/40122#issuecomment-1958763554
Makes sense! You're right that the datetime.datetimes are all the same
between base Python, pandas, Arrow and base R, they're just displayed
differently. I definitely prefer base Python and pandas's display to Arrow's
though, maybe version 16 could switch? ;)
```python
>>> pa.array([datetime.datetime(2000, 1, 1, 0, 0,
tzinfo=datetime.timezone(datetime.timedelta(hours=1)))])
<pyarrow.lib.TimestampArray object at 0x7fa7b9084280>
[
1999-12-31 23:00:00.000000
]
>>> pa.array([datetime.datetime(2000, 1, 1, 0, 0,
tzinfo=datetime.timezone(datetime.timedelta(hours=1)))]).to_pandas()
0 2000-01-01 00:00:00+01:00
dtype: datetime64[us, pytz.FixedOffset(60)]
```
For the times, I would definitely raise an error on datetime.time objects
with a non-default timezone, it seems quite dangerous to truncate the timezone
silently.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]