This is an automated email from the ASF dual-hosted git repository.

paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git


The following commit(s) were added to refs/heads/main by this push:
     new e0480fed fix(python): Remove incorrect last byte zeroing in Python 
buffer construction (#835)
e0480fed is described below

commit e0480fed53f8db3e547db5e414528a65ebdeab4f
Author: Dewey Dunnington <[email protected]>
AuthorDate: Wed Dec 17 09:48:31 2025 -0600

    fix(python): Remove incorrect last byte zeroing in Python buffer 
construction (#835)
    
    There was some code that zeroed out the last byte of a validity buffer
    in the Python buffer construction from an iterable; however, we already
    zero out the last byte when reserving/allocating an ArrowBitmap.
    
    Checked locally with:
    
    ```shell
    export NANOARROW_PLATFORM=ubuntu
    export NANOARROW_ARCH=arm64
    docker compose run --rm -e TEST_WITH_MEMCHECK=1 -e TEST_DEFAULT=0 -e 
TEST_PYTHON=1 verify
    ```
    
    Closes #821.
---
 python/src/nanoarrow/_buffer.pyx | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/python/src/nanoarrow/_buffer.pyx b/python/src/nanoarrow/_buffer.pyx
index 14b63b85..4f427e4e 100644
--- a/python/src/nanoarrow/_buffer.pyx
+++ b/python/src/nanoarrow/_buffer.pyx
@@ -1150,10 +1150,6 @@ cdef class NoneAwareWrapperIterator:
         cdef CBuffer validity
         null_count = self._item_count - self._valid_count
 
-        # If we did allocate a bitmap, make sure the last few bits are zeroed
-        if null_count > 0 and self._bitmap.size_bits % 8 != 0:
-            ArrowBitmapAppendUnsafe(&self._bitmap, 0, self._bitmap.size_bits % 
8)
-
         if null_count > 0:
             validity = CBuffer.empty()
             ArrowBufferMove(&self._bitmap.buffer, validity._ptr)

Reply via email to