jorisvandenbossche commented on code in PR #378: URL: https://github.com/apache/arrow-nanoarrow/pull/378#discussion_r1474358973
########## python/src/nanoarrow/_lib.pyx: ########## @@ -1024,23 +1076,24 @@ cdef class CBufferView: this buffer content does not apply any parent offset. """ cdef object _base - cdef ArrowBufferView* _ptr + cdef ArrowBufferView _ptr cdef ArrowBufferType _buffer_type cdef ArrowType _buffer_data_type - cdef ArrowDevice* _device + cdef CDevice _device cdef Py_ssize_t _element_size_bits cdef Py_ssize_t _shape cdef Py_ssize_t _strides cdef char _format[128] - def __cinit__(self, object base, uintptr_t addr, + def __cinit__(self, object base, uintptr_t addr, int64_t size_bytes, ArrowBufferType buffer_type, ArrowType buffer_data_type, Review Comment: Not related to this PR, just noticing while reviewing: should the buffer type be part of the buffer? That doesn't necessarily make sense for a buffer itself, only in context of a buffer as part of an array. But if you create a standalone buffer, then it doesn't make sense? ########## python/src/nanoarrow/_lib.pyx: ########## @@ -1024,23 +1076,24 @@ cdef class CBufferView: this buffer content does not apply any parent offset. """ cdef object _base - cdef ArrowBufferView* _ptr + cdef ArrowBufferView _ptr cdef ArrowBufferType _buffer_type cdef ArrowType _buffer_data_type - cdef ArrowDevice* _device + cdef CDevice _device cdef Py_ssize_t _element_size_bits cdef Py_ssize_t _shape cdef Py_ssize_t _strides cdef char _format[128] - def __cinit__(self, object base, uintptr_t addr, + def __cinit__(self, object base, uintptr_t addr, int64_t size_bytes, ArrowBufferType buffer_type, ArrowType buffer_data_type, Review Comment: It also seems we currently don't use this attribute, except for the public `type` property ########## python/src/nanoarrow/_lib.pyx: ########## @@ -1024,23 +1076,24 @@ cdef class CBufferView: this buffer content does not apply any parent offset. """ cdef object _base - cdef ArrowBufferView* _ptr + cdef ArrowBufferView _ptr cdef ArrowBufferType _buffer_type cdef ArrowType _buffer_data_type - cdef ArrowDevice* _device + cdef CDevice _device cdef Py_ssize_t _element_size_bits cdef Py_ssize_t _shape cdef Py_ssize_t _strides cdef char _format[128] - def __cinit__(self, object base, uintptr_t addr, + def __cinit__(self, object base, uintptr_t addr, int64_t size_bytes, ArrowBufferType buffer_type, ArrowType buffer_data_type, Review Comment: (I know the same is true for the data type, but at least that one you need to support exporting the buffer to an array / the buffer protocol) -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org