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

   Yes, the pattern of an object responsible for calling the release callback 
`struct ArrowWhatever` and doing a "move" whenever ownership changes is most 
consistent with how Arrow C++ does it. The user-allocated cffi structs would 
then be intermediaries (like they are when interacting with Arrow C++).
   
   You almost certainly don't want to expose the Array/ArrayView difference to 
actual users, but it's probably a useful concept in the internals (in the R 
package you can create an external pointer to an ArrayView that keeps the 
appropriate objects alive, but that's never exposed to the user). The interface 
that I exposed in the R package is more like (apologies for what is almost 
certainly invalid cython):
   
   ```cython
   cdef class Schema:
       cdef:
           ArrowArray array
           object parent
   
   cdef class Array:
       cdef:
           ArrowArray array
           ArrowSchema* schema_ptr # (might be NULL)
           object schema # (might be None or point to a Schema)
           object parent
   ```
   
   You can do a `nanoarrow_array_set_schema()` to attach a schema to an array 
(which I do internally when importing). You can in theory have an Array without 
a schema but this mostly happens at intermediary phases of passing the objects 
around.


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