jorisvandenbossche commented on issue #38026:
URL: https://github.com/apache/arrow/issues/38026#issuecomment-1748735772

   @spenczar thanks for the report!
   
   Indeed, we currently just convert the input to an array, regardless of the 
field information the user provides:
   
   
https://github.com/apache/arrow/blob/334c93726f3c9d9e69eb51136c7f354974c739fd/python/pyarrow/array.pxi#L3128C9-L3128C46
   
   This should probably have an if/else separate blocks depending on whether 
names or fields was specified, something like:
   
   ```
   if names is not None:
       arrays = [asarray(x) for x in arrays]
   else:
       arrays = [asarray(arr, field.type) for arr, field in zip(arrays, fields)]
   ```
   
   (assuming that at that point we already validated `fields` to be actual 
Field objects, which is now a bit more down, but that can be moved up)
   
   PRs to fix this are certainly welcome!


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