From 087fe6343d584195f8998031add47afadf96232e Mon Sep 17 00:00:00 2001 From: BubbleCal Date: Fri, 18 Jul 2025 16:15:06 +0800 Subject: [PATCH] test: fix random data may break test case (#2514) this test adds a new vector and then performs vector search with distance range. this may fail if the new vector becomes the closest one to the query vector Signed-off-by: BubbleCal --- python/python/tests/test_query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/python/tests/test_query.py b/python/python/tests/test_query.py index 10ee5d6e..9f51686d 100644 --- a/python/python/tests/test_query.py +++ b/python/python/tests/test_query.py @@ -272,7 +272,9 @@ async def test_distance_range_with_new_rows_async(): # append more rows so that execution plan would be mixed with ANN & Flat KNN new_data = pa.table( { - "vector": pa.FixedShapeTensorArray.from_numpy_ndarray(np.random.rand(4, 2)), + "vector": pa.FixedShapeTensorArray.from_numpy_ndarray( + np.random.rand(4, 2) + 1 + ), } ) await table.add(new_data)