edgarrmondragon commented on PR #1036:
URL: https://github.com/apache/arrow-nanoarrow/pull/1036#issuecomment-7202075096

   > the "has no validity buffer" check might have to account for the null type.
   
   Yeah, that seems right to me. An array of nulls doesn't have a buffer, so I 
think we just need to change
   
   
https://github.com/apache/arrow-nanoarrow/blob/32d9bd4d2c3a4724b3003e2dfb172d6a53ca277d/python/src/nanoarrow/_array.pyx#L171-L172
   
   to
   
   ```diff
   -         if buffer_type != NANOARROW_BUFFER_TYPE_VALIDITY:
   +         if self._ptr.storage_type == NANOARROW_TYPE_NA:
   +             self._ptr.null_count = self._ptr.length
   +         elif buffer_type != NANOARROW_BUFFER_TYPE_VALIDITY:
                 self._ptr.null_count = 0
   ```
   
   `CArrayBuilder.resolve_null_count` may have a similar bug.


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