From 544382df5e0cdb718f2f0dcf516d8b59e86e6be8 Mon Sep 17 00:00:00 2001 From: BubbleCal Date: Fri, 21 Feb 2025 13:23:39 +0800 Subject: [PATCH] fix: handle batch quires in single request (#2139) --- python/python/tests/test_remote_db.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python/python/tests/test_remote_db.py b/python/python/tests/test_remote_db.py index 746ca2e9..2d962cf0 100644 --- a/python/python/tests/test_remote_db.py +++ b/python/python/tests/test_remote_db.py @@ -388,8 +388,14 @@ def test_query_sync_maximal(): def test_query_sync_multiple_vectors(): - def handler(_body): - return pa.table({"id": [1]}) + def handler(body): + # TODO: we will add the ability to get the server version, + # so that we can decide how to perform batch quires. + vectors = body["vector"] + res = [] + for i, vector in enumerate(vectors): + res.append({"id": 1, "query_index": i}) + return pa.Table.from_pylist(res) with query_test_table(handler) as table: results = table.search([[1, 2, 3], [4, 5, 6]]).limit(1).to_list()