Skip to content

Commit 42a277c

Browse files
committed
fix: skip TextQuery tests on Redis < 7.0.0 (BM25STD not available)
BM25STD scorer was introduced in Redis 7.0.0. These tests will be skipped on Redis 6.2.6-v9 with an informative message.
1 parent 4920511 commit 42a277c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/integration/test_multi_field_sorting_integration.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from redisvl.query import FilterQuery, TextQuery, VectorQuery
77
from redisvl.redis.utils import array_to_buffer
88
from redisvl.schema import IndexSchema
9+
from tests.conftest import skip_if_redis_version_below
910

1011

1112
@pytest.fixture
@@ -301,6 +302,10 @@ class TestMultiFieldSortingTextQuery:
301302

302303
def test_text_query_with_custom_sort(self, products_index):
303304
"""Test TextQuery with custom sort field."""
305+
skip_if_redis_version_below(
306+
products_index.client, "7.0.0", "BM25STD scorer requires Redis 7.0+"
307+
)
308+
304309
query = TextQuery(
305310
text="tech",
306311
text_field_name="name",
@@ -317,6 +322,10 @@ def test_text_query_with_custom_sort(self, products_index):
317322

318323
def test_text_query_multiple_fields(self, products_index, caplog):
319324
"""Test TextQuery with multiple sort fields."""
325+
skip_if_redis_version_below(
326+
products_index.client, "7.0.0", "BM25STD scorer requires Redis 7.0+"
327+
)
328+
320329
import logging
321330

322331
caplog.set_level(logging.WARNING)

0 commit comments

Comments
 (0)