pearu opened a new issue, #54647:
URL: https://github.com/apache/arrow/issues/54647

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Timestamp parsing with a `strptime` format adds a seconds value of 60 (on 
Linux also 61) to the time of day, so it wraps into the next minute:
   
   ```python
   import pyarrow as pa
   import pyarrow.compute as pc
   
   for value in ["2020-12-31 23:59:60", "2020-12-31 23:59:61"]:
       try:
           print(pc.strptime(pa.array([value]), format="%Y-%m-%d %H:%M:%S", 
unit="s")[0])
       except pa.ArrowInvalid as e:
           print(e)
   ```
   
   Output on Linux (pyarrow 27.0.0.dev18):
   
   ```
   2021-01-01 00:00:00
   2021-01-01 00:00:01
   ```
   
   Output on macOS and Windows:
   
   ```
   2021-01-01 00:00:00
   Failed to parse string: '2020-12-31 23:59:61' as a scalar of type 
timestamp[s]
   ```
   
   Expected is a parse failure, as with the ISO-8601 parser: 
`pa.array(["2020-12-31 23:59:60"]).cast(pa.timestamp("s"))` raises 
`ArrowInvalid: Failed to parse string: '2020-12-31 23:59:60' as a scalar of 
type timestamp[s]`.
   
   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]

Reply via email to