diff --git a/python/tests/test_rerankers.py b/python/tests/test_rerankers.py index 28f422a6..aabba994 100644 --- a/python/tests/test_rerankers.py +++ b/python/tests/test_rerankers.py @@ -102,7 +102,7 @@ def test_linear_combination(tmp_path): query = "Our father who art in heaven" query_vector = table.to_pandas()["vector"][0] result = ( - table.search(vector=query_vector, text=query, query_type="vector") + table.search(vector=query_vector, text=query, query_type="hybrid") .limit(30) .rerank(normalize="score") .to_arrow() @@ -116,6 +116,7 @@ def test_linear_combination(tmp_path): "be descending." ) + # automatically deduce the query type result = ( table.search(vector=query_vector, text=query) .limit(30) @@ -123,6 +124,12 @@ def test_linear_combination(tmp_path): .to_arrow() ) + # wrong query type raises an error + with pytest.raises(ValueError): + table.search(vector=query_vector, text=query, query_type="vector").rerank( + normalize="score" + ) + @pytest.mark.skipif( os.environ.get("COHERE_API_KEY") is None, reason="COHERE_API_KEY not set"