pearu opened a new issue, #54646:
URL: https://github.com/apache/arrow/issues/54646
### Describe the bug, including details regarding any error messages,
version, and platform.
With `%s`, a number of seconds whose year is out of range gives a wrong
timestamp instead of failing:
```python
import pyarrow as pa
import pyarrow.compute as pc
for value in ["1584282600", "1000000000000000", "67768036000000000"]:
result = pc.strptime(pa.array([value]), format="%s", unit="s")
print(pc.strftime(result, format="%Y-%m-%d %H:%M:%S")[0])
```
Output on Linux and macOS (pyarrow 27.0.0.dev18):
```
2020-03-15 14:30:00
-28716-07-05 01:46:40
1893-12-04 12:26:40
```
The parser computes the year as `tm_year + 1900`, which overflows `int` for
the last value, and passes it to `date::year`, which holds 16 bits. Expected is
a parse failure for the last two values.
Found while working on #50146.
### Component(s)
C++
--
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]