AlenkaF commented on issue #39809:
URL: https://github.com/apache/arrow/issues/39809#issuecomment-1914681651
The comparison of DataTypes is done in Arrow C++ and for timestamps it is
comparing the exact timezone string (it is saved as a string) as you have
mentioned.
To do a logical comparison of timezones one should probably use a dedicated
library for that. In Python you could try with:
```python
>>> import pytz
>>> pytz.timezone(pa.timestamp("us", "UTC").tz)
<UTC>
>>> pytz.timezone(pa.timestamp("us", "utc").tz)
<UTC>
>>> pytz.timezone(pa.timestamp("us", "utc").tz) ==
pytz.timezone(pa.timestamp("us", "UTC").tz)
```
and then separately compare the timestamp unit:
```python
>>> pa.timestamp("us", "utc").unit == pa.timestamp("us", "UTC").unit
True
```
--
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]