singhpratech commented on issue #36110:
URL: https://github.com/apache/arrow/issues/36110#issuecomment-5579337248
Still present in pyarrow 25.0.1 on macOS 26.6 (arm64), and it is not only a
slim-file matter: the
system zoneinfo here is a fat TZif version 2 file (America/New_York, 3552
bytes, transitions
tabulated through 2037, footer `EST5EDT,M3.2.0,M11.1.0`), and
`assume_timezone` gives the winter
offset for every July instant from 2038 on while `zoneinfo` and `zdump`
apply the footer rule:
```python
import datetime as dt, zoneinfo, pyarrow as pa, pyarrow.compute as pc
tz = zoneinfo.ZoneInfo("America/New_York")
for year in (2037, 2038, 2050):
naive = dt.datetime(year, 7, 15, 12, 0)
utc = pc.assume_timezone(pa.array([naive], pa.timestamp("s")),
"America/New_York").cast(pa.timestamp("s", "UTC")).to_pylist()[0]
print(year, int((naive - utc.replace(tzinfo=None)).total_seconds()),
int(naive.replace(tzinfo=tz).utcoffset().total_seconds()))
# 2037 -14400 -14400
# 2038 -18000 -14400
# 2050 -18000 -14400
```
(I filed #51226 for this before finding this issue; it is closed as a
duplicate.)
--
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]