What breaks
Calling MRRReranker.rerank_multivector([]) raises an IndexError: list index out of range instead of a descriptive error.
How to trigger
from lancedb.rerankers.mrr import MRRReranker
reranker = MRRReranker()
reranker.rerank_multivector([]) # IndexError: list index out of range
Traceback
File "lancedb/rerankers/mrr.py", line 128, in rerank_multivector
if not all(isinstance(v, type(vector_results[0])) for v in vector_results):
~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Root cause
On line 128 the type-homogeneity check uses all() which passes vacuously on an empty iterable. Execution then reaches line 134 which accesses vector_results[0] unconditionally, crashing with IndexError. There is no guard against an empty input list.
What breaks
Calling
MRRReranker.rerank_multivector([])raises anIndexError: list index out of rangeinstead of a descriptive error.How to trigger
Traceback
Root cause
On line 128 the type-homogeneity check uses
all()which passes vacuously on an empty iterable. Execution then reaches line 134 which accessesvector_results[0]unconditionally, crashing withIndexError. There is no guard against an empty input list.