Milad137 commented on issue #13111:
URL: https://github.com/apache/arrow/issues/13111#issuecomment-1122996553
The first 2 are working fine, it's just the last one, when the "%p" tag gets
added, it throughs an error.
```
>>> import pandas as pd
>>> import pyarrow.compute as pc
>>> # pd.__version__ == '1.3.4'
>>> # pyarrow.__version__ == '8.0.0'
>>> _ts = ["9/03/2043 12:35"]
>>> _format = "%d/%m/%Y %I:%M"
>>> print(pc.strptime(_ts, format= _format, unit='s'))
[
2043-03-09 12:35:00
]
>>> _ts = ["9/03/2043"]
>>> _format = "%d/%m/%Y"
>>> print(pc.strptime(_ts, format= _format, unit='s'))
[
2043-03-09 00:00:00
]
>>> _ts = ["12:35 AM"]
>>> _format = "%I:%M %p"
>>> print(pc.strptime(_ts, format= _format, unit='s'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~\anaconda3\lib\site-packages\pyarrow\compute.py", line 250, in
wrapper
return func.call(args, options, memory_pool)
File "pyarrow\_compute.pyx", line 341, in pyarrow._compute.Function.call
File "pyarrow\error.pxi", line 144, in
pyarrow.lib.pyarrow_internal_check_status
File "pyarrow\error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Failed to parse string: '12:35 AM' as a scalar of
type timestamp[s]
```
--
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]