From 04e97e4a36e9972af1c27b1c9c8905856c665299 Mon Sep 17 00:00:00 2001 From: Gatefixer <313497061+lancedb-gatefixer[bot]@users.noreply.github.com> Date: Sat, 8 Aug 2026 12:14:27 +0000 Subject: [PATCH] test(python): cover filtered hybrid search results --- python/python/tests/test_hybrid_query.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/python/tests/test_hybrid_query.py b/python/python/tests/test_hybrid_query.py index 72dcaaa49..40da2d76c 100644 --- a/python/python/tests/test_hybrid_query.py +++ b/python/python/tests/test_hybrid_query.py @@ -365,6 +365,20 @@ def test_hybrid_prefilter_explain_plan(table_with_id: Table): ) +def test_hybrid_prefilter_returns_filtered_row(table_with_id: Table): + """Regression test for https://github.com/lancedb/lancedb/issues/2435.""" + results = ( + table_with_id.search(query_type="hybrid") + .vector([0.1, 0.1]) + .text("dog") + .where("id = 3", prefilter=True) + .limit(1) + .to_arrow() + ) + + assert results["id"].to_pylist() == [3] + + def test_normalize_scores(): cases = [ (pa.array([0.1, 0.4]), pa.array([0.0, 1.0])),