From 94024e1f6f24f5ba76244c90cf9b50b1e56bc5dc Mon Sep 17 00:00:00 2001 From: hh-space-invader Date: Fri, 13 Sep 2024 20:52:04 +0300 Subject: [PATCH] chore: Added a test case for query using nested prefetch in congruence tests --- tests/congruence_tests/test_query.py | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/congruence_tests/test_query.py b/tests/congruence_tests/test_query.py index 4d428f59..f8c74740 100644 --- a/tests/congruence_tests/test_query.py +++ b/tests/congruence_tests/test_query.py @@ -583,6 +583,23 @@ def deep_dense_queries_orderby(self, client: QdrantBase) -> models.QueryResponse limit=10, ) + def dense_query_text_nested_prefetch(self, client: QdrantBase) -> models.QueryResponse: + return client.query_points( + collection_name=COLLECTION_NAME, + prefetch=[ + models.Prefetch( + prefetch=models.Prefetch( + query=self.dense_vector_query_text, + using="text" + ), + query=self.dense_vector_query_text, + using="text" + ), + ], + query=self.dense_vector_query_text, + using="text" + ) + @classmethod def dense_recommend_image(cls, client: QdrantBase) -> models.QueryResponse: return client.query_points( @@ -814,6 +831,20 @@ def test_no_query_no_prefetch(): compare_clients_results(http_client, grpc_client, grpc_client, searcher.query_scroll_offset) +def test_dense_query_nested_prefetch(): + major, minor, patch, dev = read_version() + if not dev and None not in (major, minor, patch) and (major, minor, patch) < (1, 10, 0): + pytest.skip("Works as of version 1.10.0") + + fixture_points = generate_fixtures() + + searcher = TestSimpleSearcher() + + local_client, http_client, grpc_client = init_clients(fixture_points) + + compare_clients_results(local_client, http_client, grpc_client, searcher.dense_query_text_nested_prefetch) + + def test_dense_query_filtered_prefetch(): fixture_points = generate_fixtures()