From 38fda1fd9fc493817eee38be7ffc00640c481bf0 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Fri, 1 Aug 2025 11:08:53 +0100 Subject: [PATCH 1/8] Updates test image Signed-off-by: Elena Kolevska --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index b720e1d99c..ad86633535 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-RC2-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.4', '7.2.9'] python-version: ['3.9', '3.13'] parser-backend: ['plain'] event-loop: ['asyncio'] From 6a4c16fcbbab03eb6614d865d3b8343b80fede26 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Fri, 1 Aug 2025 12:02:56 +0100 Subject: [PATCH 2/8] Adds testcase for RECUCE and COMPRESSION in ft.createindex Signed-off-by: Elena Kolevska --- tests/test_search.py | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/test_search.py b/tests/test_search.py index 3460b56ca1..d0e1ca4bbc 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -3802,3 +3802,51 @@ 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": "LVQ8", # 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"] \ No newline at end of file From 2681470de4bdb04f165d00fbcb49202b1ef33c62 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Fri, 1 Aug 2025 12:11:00 +0100 Subject: [PATCH 3/8] linter Signed-off-by: Elena Kolevska --- tests/test_search.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_search.py b/tests/test_search.py index d0e1ca4bbc..5f2cc7d3fd 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -3803,6 +3803,7 @@ def test_svs_vamana_vector_search_with_parameters(client): 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") @@ -3849,4 +3850,4 @@ def test_svs_vamana_vector_search_with_parameters_leanvec(client): assert "doc0" == res.docs[0].id else: assert res["total_results"] == 3 - assert "doc0" == res["results"][0]["id"] \ No newline at end of file + assert "doc0" == res["results"][0]["id"] From 4ffe1a8400c645e493b519528ac85fcb470520f7 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Fri, 1 Aug 2025 14:10:04 +0100 Subject: [PATCH 4/8] case sensitive imnage name Signed-off-by: Elena Kolevska --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index ad86633535..5f1922ff07 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-RC2-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.4', '7.2.9'] + redis-version: ['8.2-rc2-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.4', '7.2.9'] python-version: ['3.9', '3.13'] parser-backend: ['plain'] event-loop: ['asyncio'] From 1fc6ac7f1375a6cc7300f3cd6d4d6e1eea629ca7 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Fri, 1 Aug 2025 14:19:07 +0100 Subject: [PATCH 5/8] Updates compression Signed-off-by: Elena Kolevska --- tests/test_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_search.py b/tests/test_search.py index 5f2cc7d3fd..c28b4aa932 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -3817,7 +3817,7 @@ def test_svs_vamana_vector_search_with_parameters_leanvec(client): "TYPE": "FLOAT32", "DIM": 8, "DISTANCE_METRIC": "L2", - "COMPRESSION": "LVQ8", # LeanVec compression required for REDUCE + "COMPRESSION": "LeanVec8x8", # LeanVec compression required for REDUCE "CONSTRUCTION_WINDOW_SIZE": 200, "GRAPH_MAX_DEGREE": 32, "SEARCH_WINDOW_SIZE": 15, From a3a564faa08886791368a1d197f964ad356ee09d Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Tue, 5 Aug 2025 15:12:39 +0300 Subject: [PATCH 6/8] Removed already covered Python version from matrix --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 5f1922ff07..e8ce764967 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -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: From 6ea93300fa59a1fc2024b2fdae07787856259656 Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Tue, 5 Aug 2025 17:07:03 +0300 Subject: [PATCH 7/8] Updated test image --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index e8ce764967..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-rc2-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'] From b7fdd495d8299348f6915945bf9a6880f92b953d Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Wed, 6 Aug 2025 09:39:52 +0300 Subject: [PATCH 8/8] Updated test cases --- tests/test_asyncio/test_vsets.py | 2 +- tests/test_vsets.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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_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")