Fokko commented on code in PR #4425:
URL: https://github.com/apache/iceberg-python/pull/4425#discussion_r4628874024


##########
tests/table/test_deletion_vector.py:
##########
@@ -133,6 +134,23 @@ def test_map_empty() -> None:
     actual = DeletionVector._deserialize_bitmap(puffin)
 
     assert expected == actual
+    vector = DeletionVector("data.parquet", actual).to_vector()
+    assert vector.type == pa.int64()
+    assert vector.to_pylist() == []
+
+
+def test_to_vector_with_empty_bitmaps_for_low_keys() -> None:
+    # Keys without positions have empty bitmaps, such as key 0 when every 
position is at or above 2**32
+    for bitmaps, expected in [
+        ([BitMap(), BitMap([5])], [2**32 + 5]),
+        ([BitMap(), BitMap(), BitMap([0, 7])], [2 * 2**32, 2 * 2**32 + 7]),
+        ([BitMap([2]), BitMap(), BitMap([1])], [2, 2 * 2**32 + 1]),
+        ([BitMap()], []),
+        ([BitMap(), BitMap()], []),

Review Comment:
   Yes, this is a good point, but still a trade-off. On the other side, if 
there would be any issues with `BitMap()`, then the tests wouldn't load at all. 
Therefore we went with this approach (for now).



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to