paleolimbot commented on code in PR #464:
URL: https://github.com/apache/arrow-nanoarrow/pull/464#discussion_r1603413301


##########
python/tests/test_nanoarrow.py:
##########
@@ -183,6 +183,45 @@ def test_c_array_view_dictionary():
     assert "- dictionary: <nanoarrow.c_array.CArrayView>" in repr(view)
 
 
+def test_c_array_view_null_count():
+    # With explicit null count == 0
+    array = na.c_array_from_buffers(
+        na.int32(), 3, (None, na.c_buffer([1, 2, 3], na.int32())), null_count=0
+    )
+    assert array.view().null_count == 0
+
+    # Infer null count == 0 because of null data buffer
+    array = na.c_array_from_buffers(
+        na.int32(), 3, (None, na.c_buffer([1, 2, 3], na.int32())), 
null_count=-1

Review Comment:
   I added comments to each of these...-1 is the sentinel for "not computed 
yet". Technically it's the default but here it's exactly what we're testing.



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