randolf-scholz opened a new issue, #36088:
URL: https://github.com/apache/arrow/issues/36088

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Was trying to convert some json-data to `list[int]`:
   
   ```python
   import pyarrow as pa
   import json
   
   print(pa.__version__)
   data = pa.array(["[1,2,3]", "[4,5,6]"], type=pa.string())
   dtype = pa.list_(pa.int32())
   
   
   def convert_py_list(x:pa.StringScalar) -> list[int]:
       return json.loads(x.as_py())
   
   def convert_pa_list(x:pa.StringScalar) -> list[int]:
       return pa.scalar(json.loads(x.as_py()), type=dtype)
   
   pa.array([convert_py_list(x) for x in data], type=dtype)  # ✔
   pa.array([convert_pa_list(x) for x in data], type=dtype)  # ✘ ArrowInvalid
   ```
   
   pyarrow version 12.0.1
   
   
   ### Component(s)
   
   Python


-- 
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