mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-16 00:32:26 +00:00
fix: omit unfetchable list blobs from column discovery (#4312)
This commit is contained in:
@@ -2104,7 +2104,11 @@ class Table(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def blob_columns(self) -> list[str]:
|
||||
"""Names of the blob v2 columns declared on this table."""
|
||||
"""Names of blob v2 columns that can be fetched by row id.
|
||||
|
||||
Struct-nested blobs use dotted paths. Blobs inside lists are omitted
|
||||
because a row id does not identify an individual list element.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def fetch_blobs(
|
||||
@@ -2123,6 +2127,8 @@ class Table(ABC):
|
||||
One missing or deleted row ID rejects the entire batch; no partial
|
||||
results are returned.
|
||||
|
||||
Blobs inside lists cannot be fetched by row id yet.
|
||||
|
||||
Remote servers limit each request to 1024 row IDs and 64 MiB of blob
|
||||
bytes. The client splits requests automatically and reads an individual
|
||||
larger blob through the Range route. This method still materializes all
|
||||
|
||||
@@ -879,12 +879,18 @@ def test_merge_insert_list_blob_dicts():
|
||||
|
||||
def test_list_blob_column_queries_as_raw_descriptors():
|
||||
table = _list_blob_table("list_query")
|
||||
assert table.blob_columns() == []
|
||||
hits = table.search().limit(10).to_arrow()
|
||||
element = hits.schema.field("images").type.value_type
|
||||
assert pa.types.is_struct(element)
|
||||
assert "_lance_row_id" not in element.names
|
||||
with pytest.raises(ValueError, match="expected struct before segment"):
|
||||
table.fetch_blobs("images.image", [0])
|
||||
for column in ("images", "images.image"):
|
||||
with pytest.raises(ValueError, match="blobs inside lists cannot be fetched"):
|
||||
table.fetch_blobs(column, [0])
|
||||
with pytest.raises(ValueError, match="blobs inside lists cannot be fetched"):
|
||||
table.fetch_blob_files(column, [0])
|
||||
with pytest.raises(ValueError, match="blobs inside lists cannot be fetched"):
|
||||
table.fetch_blob_ranges(column, [(0, 0, 1)])
|
||||
|
||||
|
||||
def test_row_addressable_paths_exclude_list_children():
|
||||
|
||||
Reference in New Issue
Block a user