paleolimbot commented on PR #367:
URL: https://github.com/apache/arrow-nanoarrow/pull/367#issuecomment-1900755078

   >  why not just return self._ptr.array.n_buffers here?
   
   I've tried to remove all references to `ArrayView.array` from nanoarrow (C, 
Python, R, and otherwise), although I haven't removed the member from the 
`ArrayView` yet because I think some previous code relies on it. Basically, the 
`ArrowArrayView` doesn't care how the memory it's pointing to got there (i.e., 
there's no requirement that an `ArrowArray` ever existed). This is mostly 
helpful for reading IPC: the decoder first fills in an ArrowArrayView and only 
allocates the `ArrowArray` if requested.
   
   > Because if we don't consider the variadic buffers as part of the 
ArrayView's buffers, then accessing like the above in Python doesn't work for 
those
   
   That's true. We could rewrite `n_buffers()` to `+= _ptr.n_variadic_buffers` 
and rewrite `buffer()` to create a buffer view from the variaidic buffers if 
`i` is large enough (or error, since accessing variadic buffers directly isn't 
strictly needed to decode the content).


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