diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index b720e1d99c..43766b072b 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -74,7 +74,7 @@ jobs: max-parallel: 15 fail-fast: false matrix: - redis-version: ['8.2-RC1-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.4', '7.2.9'] + redis-version: ['8.2', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.4', '7.2.9'] python-version: ['3.9', '3.13'] parser-backend: ['plain'] event-loop: ['asyncio'] @@ -99,7 +99,7 @@ jobs: fail-fast: false matrix: redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ] - python-version: ['3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10'] + python-version: ['3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10'] parser-backend: [ 'plain' ] event-loop: [ 'asyncio' ] env: diff --git a/tests/test_asyncio/test_vsets.py b/tests/test_asyncio/test_vsets.py index 01c2f3c95a..8294d8aff4 100644 --- a/tests/test_asyncio/test_vsets.py +++ b/tests/test_asyncio/test_vsets.py @@ -435,7 +435,7 @@ async def test_vsim_epsilon(d_client): assert 5 == len(res1) res2 = await d_client.vset().vsim("myset", [2, 1, 1], epsilon=0.5) - assert 3 == len(res2) + assert 4 == len(res2) @skip_if_server_version_lt("7.9.0") diff --git a/tests/test_search.py b/tests/test_search.py index 3460b56ca1..c28b4aa932 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -3802,3 +3802,52 @@ def test_svs_vamana_vector_search_with_parameters(client): else: assert res["total_results"] == 3 assert "doc0" == res["results"][0]["id"] + + +@pytest.mark.redismod +@skip_ifmodversion_lt("2.4.3", "search") +@skip_if_server_version_lt("8.1.224") +def test_svs_vamana_vector_search_with_parameters_leanvec(client): + client.ft().create_index( + ( + VectorField( + "v", + "SVS-VAMANA", + { + "TYPE": "FLOAT32", + "DIM": 8, + "DISTANCE_METRIC": "L2", + "COMPRESSION": "LeanVec8x8", # LeanVec compression required for REDUCE + "CONSTRUCTION_WINDOW_SIZE": 200, + "GRAPH_MAX_DEGREE": 32, + "SEARCH_WINDOW_SIZE": 15, + "EPSILON": 0.01, + "TRAINING_THRESHOLD": 1024, + "REDUCE": 4, # Half of DIM (8/2 = 4) + }, + ), + ) + ) + + # Create test vectors (8-dimensional to match DIM) + vectors = [ + [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], + [2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0], + [3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], + [4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0], + [5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0], + ] + + for i, vec in enumerate(vectors): + client.hset(f"doc{i}", "v", np.array(vec, dtype=np.float32).tobytes()) + + query = Query("*=>[KNN 3 @v $vec as score]").no_content() + query_params = {"vec": np.array(vectors[0], dtype=np.float32).tobytes()} + + res = client.ft().search(query, query_params=query_params) + if is_resp2_connection(client): + assert res.total == 3 + assert "doc0" == res.docs[0].id + else: + assert res["total_results"] == 3 + assert "doc0" == res["results"][0]["id"] diff --git a/tests/test_vsets.py b/tests/test_vsets.py index 38776cc102..e212b1b286 100644 --- a/tests/test_vsets.py +++ b/tests/test_vsets.py @@ -437,7 +437,7 @@ def test_vsim_epsilon(d_client): assert 5 == len(res1) res2 = d_client.vset().vsim("myset", [2, 1, 1], epsilon=0.5) - assert 3 == len(res2) + assert 4 == len(res2) @skip_if_server_version_lt("7.9.0")