fix: identify missing blob row IDs in batch errors

This commit is contained in:
Gatefixer
2026-09-24 00:34:53 +00:00
parent 02666469fc
commit 3f079b7b32
9 changed files with 158 additions and 23 deletions
+6
View File
@@ -1937,6 +1937,8 @@ class Table(ABC):
``row_ids`` may be a list, an integer Arrow array or chunked array,
or a query table with row ids. ``_rowid`` values stay valid after
compaction when the table has stable row ids.
One missing or deleted row ID rejects the entire batch; no partial
results are returned.
Convenience for small payloads. For large values use
:meth:`fetch_blob_files`.
@@ -1958,6 +1960,8 @@ class Table(ABC):
``_rowid`` values stay valid after compaction when the table has stable
row ids.
One missing or deleted row ID rejects the entire batch; no partial
results are returned.
Row IDs can be obtained from a query with ``with_row_id(True)``. This
API is currently supported only by local tables.
@@ -1979,6 +1983,8 @@ class Table(ABC):
``_rowid`` values stay valid after compaction when the table has stable
row ids.
One missing or deleted row ID rejects the entire batch; no partial
handles are returned.
"""
@abstractmethod
+4
View File
@@ -74,15 +74,19 @@ def _assert_missing_blob_row_ids(exc_info):
def _assert_fetch_apis_reject_missing_row_ids(table, row_ids):
expected = f"first missing row ids: [{row_ids[0]}]"
with pytest.raises(ValueError) as exc_info:
table.fetch_blobs("image", row_ids)
_assert_missing_blob_row_ids(exc_info)
assert expected in str(exc_info.value)
with pytest.raises(ValueError) as exc_info:
table.fetch_blob_files("image", row_ids)
_assert_missing_blob_row_ids(exc_info)
assert expected in str(exc_info.value)
with pytest.raises(ValueError) as exc_info:
table.fetch_blob_ranges("image", [(row_id, 0, 1) for row_id in row_ids])
_assert_missing_blob_row_ids(exc_info)
assert expected in str(exc_info.value)
def test_blob_factory_declares_v2_field():