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

   Related issue: https://github.com/apache/arrow/issues/38137 (it also shows a 
workaround how you can currently zero-copy convert such object to arrow)
   
   While this indeed seems unexpected, the underlying issue is that we simply 
don't have specific support for objects implementing the buffer protocol, but 
only for very specifically numpy arrays or pandas array-likes (and as a result, 
we see the memoryview as a generic python sequence, essentially converting it 
to a list of python floats before converting to arrow). 
   
   We should expand `pa.array()` to support objects implementing the buffer 
protocol (and eg in that case convert to a numpy array and use the code path 
for numpy). 
   I am not sure you can easily check from python if an object supports the 
buffer protocol, but given this function lives in cython, I assume we can use 
something like `PyObject_CheckBuffer` 


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