#4284·lancedb

bug(python): blob read APIs handle row-id inputs and errors inconsistently

Author: XuanwoCreated Sep 23, 2026Updated Sep 23, 2026
LabelsbugPython

Problem

The blob read APIs handle row-id inputs inconsistently, and the errors come in different types and styles depending on where they are raised:

python
t = db.create_table("t", schema=pa.schema([pa.field("id", pa.int64()), lancedb.blob("payload")]))
t.add(pa.table({"id": [0, 1, 2], "payload": pa.array([b"a", b"b", b"c"], pa.large_binary())}))
hits = t.search().with_row_id(True).to_arrow()
call result
fetch_blobs("payload", [3]) (past the fragment end) ValueError: Invalid input, Invalid read params Range(3..4) for fragment with 3 addressable rows
fetch_blobs("payload", [(7 << 32) | 0]) (missing fragment) ValueError: … requested 1 row ids but some do not exist in the table; pass row ids collected from this table
fetch_blobs("payload", hits["_rowid"]) ValueError: pass a query table with _rowid, not a column array (use fetch_blobs('image', hits), …)
fetch_blob_ranges("payload", [[0, 0, 1]]) TypeError: argument 'requests': 'list' object is not an instance of 'tuple'
fetch_blobs("payload", [-1]) OverflowError: can't convert negative int to unsigned
stable-row-id table, deleted id raw lance message Could not resolve all requested row IDs … first missing row ID 1 was deleted or not found

The first two are the same user mistake (a row id that isn't in the table) with different messages. The third rejects a natural input (an integer row-id column) with a message that assumes the blob column was passed.

Root cause

  • map_blob_take_error in rust/lancedb/src/blob.rs matches only two lance error strings. It misses the "Invalid read params" error from the fragment reader and the stable-row-id miss.
  • python/python/lancedb/_blob.py rejects every pa.Array / pa.ChunkedArray as row ids.
  • fetch_blob_ranges in python/src/table.rs declares Vec<(u64, u64, u64)>, so only tuples of non-negative ints are accepted.

Fix direction

  • Map all row-id-not-found cases to the same ValueError. Better, have lance return a typed not-found error so lancedb doesn't match strings.
  • Accept integer pa.Array / ChunkedArray row ids.
  • Accept any 3-item sequence in fetch_blob_ranges, and raise ValueError for negative row ids, offsets or lengths.

Environment

lancedb 0.40.0b5, pylance 13.0.0b8, local tables. Same code on main.

Found during the Blob V2 bug bash (2026-09-23).