chaokunyang opened a new issue, #35925:
URL: https://github.com/apache/arrow/issues/35925
### Describe the bug, including details regarding any error messages,
version, and platform.
Arrow raise `ArrowInvalid` exception when parsing non-numerical value to
float failed even `allow_invalid_utf8` is true:
```python
str_arr = pa.array(["100", "200.22", "2acv"])
str_arr.cast(options=pc.CastOptions(target_type=pa.float64(),
allow_invalid_utf8=True))
```
Exception:
```
---------------------------------------------------------------------------
ArrowInvalid Traceback (most recent call last)
Cell In[3], line 3
1 str_arr = pa.array(["100", "200.22", "2acv"])
2 print(pa.__version__)
----> 3 str_arr.cast(options=pc.CastOptions(target_type=pa.float64(),
allow_invalid_utf8=True))
File
~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/array.pxi:935, in
pyarrow.lib.Array.cast()
File
~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/compute.py:400, in
cast(arr, target_type, safe, options, memory_pool)
398 else:
399 options = CastOptions.safe(target_type)
--> 400 return call_function("cast", [arr], options, memory_pool)
File
~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/_compute.pyx:572, in
pyarrow._compute.call_function()
File
~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/_compute.pyx:367, in
pyarrow._compute.Function.call()
File
~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/error.pxi:144, in
pyarrow.lib.pyarrow_internal_check_status()
File
~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/error.pxi:100, in
pyarrow.lib.check_status()
ArrowInvalid: Failed to parse string: '2acv' as a scalar of type double
```
### 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]