Skip to content

Commit b2dd8e8

Browse files
authoredJan 21, 2025··
Added Redis 8.0 to test matrix (#3469)
* Added Redis 8.0 to test matrix * Fixed test cases * Added version annotation * Changed FT.PROFILE response type * Added version restrictions * Updated file names, fixed tests assertions * Removed unused API
1 parent eff310f commit b2dd8e8

17 files changed

+195
-97
lines changed
 

‎.github/workflows/integration.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
max-parallel: 15
7575
fail-fast: false
7676
matrix:
77-
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}', '7.2.6', '6.2.16']
77+
redis-version: ['8.0-M02', '${{ needs.redis_version.outputs.CURRENT }}', '7.2.6', '6.2.16']
7878
python-version: ['3.8', '3.12']
7979
parser-backend: ['plain']
8080
event-loop: ['asyncio']

‎doctests/query_agg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from redis.commands.search import Search
77
from redis.commands.search.aggregation import AggregateRequest
88
from redis.commands.search.field import NumericField, TagField
9-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
9+
from redis.commands.search.index_definition import IndexDefinition, IndexType
1010
import redis.commands.search.reducers as reducers
1111

1212
r = redis.Redis(decode_responses=True)

‎doctests/query_combined.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import warnings
77
from redis.commands.json.path import Path
88
from redis.commands.search.field import NumericField, TagField, TextField, VectorField
9-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
9+
from redis.commands.search.index_definition import IndexDefinition, IndexType
1010
from redis.commands.search.query import Query
1111
from sentence_transformers import SentenceTransformer
1212

‎doctests/query_em.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import redis
55
from redis.commands.json.path import Path
66
from redis.commands.search.field import TextField, NumericField, TagField
7-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
7+
from redis.commands.search.index_definition import IndexDefinition, IndexType
88
from redis.commands.search.query import NumericFilter, Query
99

1010
r = redis.Redis(decode_responses=True)

‎doctests/query_ft.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import redis
66
from redis.commands.json.path import Path
77
from redis.commands.search.field import TextField, NumericField, TagField
8-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
8+
from redis.commands.search.index_definition import IndexDefinition, IndexType
99
from redis.commands.search.query import NumericFilter, Query
1010

1111
r = redis.Redis(decode_responses=True)

‎doctests/query_geo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import redis
66
from redis.commands.json.path import Path
77
from redis.commands.search.field import GeoField, GeoShapeField
8-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
8+
from redis.commands.search.index_definition import IndexDefinition, IndexType
99
from redis.commands.search.query import Query
1010

1111
r = redis.Redis(decode_responses=True)

‎doctests/query_range.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import redis
66
from redis.commands.json.path import Path
77
from redis.commands.search.field import TextField, NumericField, TagField
8-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
8+
from redis.commands.search.index_definition import IndexDefinition, IndexType
99
from redis.commands.search.query import NumericFilter, Query
1010

1111
r = redis.Redis(decode_responses=True)

‎doctests/search_quickstart.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import redis.commands.search.reducers as reducers
1111
from redis.commands.json.path import Path
1212
from redis.commands.search.field import NumericField, TagField, TextField
13-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
13+
from redis.commands.search.index_definition import IndexDefinition, IndexType
1414
from redis.commands.search.query import Query
1515

1616
# HIDE_END

‎doctests/search_vss.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
TextField,
2121
VectorField,
2222
)
23-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
23+
from redis.commands.search.index_definition import IndexDefinition, IndexType
2424
from redis.commands.search.query import Query
2525
from sentence_transformers import SentenceTransformer
2626

‎redis/commands/helpers.py

-23
Original file line numberDiff line numberDiff line change
@@ -79,29 +79,6 @@ def parse_list_to_dict(response):
7979
return res
8080

8181

82-
def parse_to_dict(response):
83-
if response is None:
84-
return {}
85-
86-
res = {}
87-
for det in response:
88-
if not isinstance(det, list) or not det:
89-
continue
90-
if len(det) == 1:
91-
res[det[0]] = True
92-
elif isinstance(det[1], list):
93-
res[det[0]] = parse_list_to_dict(det[1])
94-
else:
95-
try: # try to set the attribute. may be provided without value
96-
try: # try to convert the value to float
97-
res[det[0]] = float(det[1])
98-
except (TypeError, ValueError):
99-
res[det[0]] = det[1]
100-
except IndexError:
101-
pass
102-
return res
103-
104-
10582
def random_string(length=10):
10683
"""
10784
Returns a random N character long string.

‎redis/commands/search/commands.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
from redis.client import NEVER_DECODE, Pipeline
66
from redis.utils import deprecated_function
77

8-
from ..helpers import get_protocol_version, parse_to_dict
8+
from ..helpers import get_protocol_version
99
from ._util import to_string
1010
from .aggregation import AggregateRequest, AggregateResult, Cursor
1111
from .document import Document
1212
from .field import Field
13-
from .indexDefinition import IndexDefinition
13+
from .index_definition import IndexDefinition
14+
from .profile_information import ProfileInformation
1415
from .query import Query
1516
from .result import Result
1617
from .suggestion import SuggestionParser
@@ -67,7 +68,7 @@ class SearchCommands:
6768

6869
def _parse_results(self, cmd, res, **kwargs):
6970
if get_protocol_version(self.client) in ["3", 3]:
70-
return res
71+
return ProfileInformation(res) if cmd == "FT.PROFILE" else res
7172
else:
7273
return self._RESP2_MODULE_CALLBACKS[cmd](res, **kwargs)
7374

@@ -101,7 +102,7 @@ def _parse_profile(self, res, **kwargs):
101102
with_scores=query._with_scores,
102103
)
103104

104-
return result, parse_to_dict(res[1])
105+
return result, ProfileInformation(res[1])
105106

106107
def _parse_spellcheck(self, res, **kwargs):
107108
corrections = {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from typing import Any
2+
3+
4+
class ProfileInformation:
5+
"""
6+
Wrapper around FT.PROFILE response
7+
"""
8+
9+
def __init__(self, info: Any) -> None:
10+
self._info: Any = info
11+
12+
@property
13+
def info(self) -> Any:
14+
return self._info

‎tests/test_asyncio/test_search.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@
1919
TextField,
2020
VectorField,
2121
)
22-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
22+
from redis.commands.search.index_definition import IndexDefinition, IndexType
2323
from redis.commands.search.query import GeoFilter, NumericFilter, Query
2424
from redis.commands.search.result import Result
2525
from redis.commands.search.suggestion import Suggestion
2626
from tests.conftest import (
2727
is_resp2_connection,
2828
skip_if_redis_enterprise,
2929
skip_if_resp_version,
30+
skip_if_server_version_gte,
31+
skip_if_server_version_lt,
3032
skip_ifmodversion_lt,
3133
)
3234

@@ -1111,6 +1113,7 @@ async def test_get(decoded_r: redis.Redis):
11111113
@pytest.mark.redismod
11121114
@pytest.mark.onlynoncluster
11131115
@skip_ifmodversion_lt("2.2.0", "search")
1116+
@skip_if_server_version_gte("7.9.0")
11141117
async def test_config(decoded_r: redis.Redis):
11151118
assert await decoded_r.ft().config_set("TIMEOUT", "100")
11161119
with pytest.raises(redis.ResponseError):
@@ -1121,6 +1124,19 @@ async def test_config(decoded_r: redis.Redis):
11211124
assert "100" == res["TIMEOUT"]
11221125

11231126

1127+
@pytest.mark.redismod
1128+
@pytest.mark.onlynoncluster
1129+
@skip_if_server_version_lt("7.9.0")
1130+
async def test_config_with_removed_ftconfig(decoded_r: redis.Redis):
1131+
assert await decoded_r.config_set("timeout", "100")
1132+
with pytest.raises(redis.ResponseError):
1133+
await decoded_r.config_set("timeout", "null")
1134+
res = await decoded_r.config_get("*")
1135+
assert "100" == res["timeout"]
1136+
res = await decoded_r.config_get("timeout")
1137+
assert "100" == res["timeout"]
1138+
1139+
11241140
@pytest.mark.redismod
11251141
@pytest.mark.onlynoncluster
11261142
async def test_aggregations_groupby(decoded_r: redis.Redis):

‎tests/test_commands.py

+26
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,7 @@ def try_delete_libs(self, r, *lib_names):
18231823

18241824
@pytest.mark.onlynoncluster
18251825
@skip_if_server_version_lt("7.1.140")
1826+
@skip_if_server_version_gte("7.9.0")
18261827
def test_tfunction_load_delete(self, stack_r):
18271828
self.try_delete_libs(stack_r, "lib1")
18281829
lib_code = self.generate_lib_code("lib1")
@@ -1831,6 +1832,7 @@ def test_tfunction_load_delete(self, stack_r):
18311832

18321833
@pytest.mark.onlynoncluster
18331834
@skip_if_server_version_lt("7.1.140")
1835+
@skip_if_server_version_gte("7.9.0")
18341836
def test_tfunction_list(self, stack_r):
18351837
self.try_delete_libs(stack_r, "lib1", "lib2", "lib3")
18361838
assert stack_r.tfunction_load(self.generate_lib_code("lib1"))
@@ -1861,6 +1863,7 @@ def test_tfunction_list(self, stack_r):
18611863

18621864
@pytest.mark.onlynoncluster
18631865
@skip_if_server_version_lt("7.1.140")
1866+
@skip_if_server_version_gte("7.9.0")
18641867
def test_tfcall(self, stack_r):
18651868
self.try_delete_libs(stack_r, "lib1")
18661869
assert stack_r.tfunction_load(self.generate_lib_code("lib1"))
@@ -4329,6 +4332,7 @@ def test_xgroup_create_mkstream(self, r):
43294332
assert r.xinfo_groups(stream) == expected
43304333

43314334
@skip_if_server_version_lt("7.0.0")
4335+
@skip_if_server_version_gte("7.9.0")
43324336
def test_xgroup_create_entriesread(self, r: redis.Redis):
43334337
stream = "stream"
43344338
group = "group"
@@ -4350,6 +4354,28 @@ def test_xgroup_create_entriesread(self, r: redis.Redis):
43504354
]
43514355
assert r.xinfo_groups(stream) == expected
43524356

4357+
@skip_if_server_version_lt("7.9.0")
4358+
def test_xgroup_create_entriesread_with_fixed_lag_field(self, r: redis.Redis):
4359+
stream = "stream"
4360+
group = "group"
4361+
r.xadd(stream, {"foo": "bar"})
4362+
4363+
# no group is setup yet, no info to obtain
4364+
assert r.xinfo_groups(stream) == []
4365+
4366+
assert r.xgroup_create(stream, group, 0, entries_read=7)
4367+
expected = [
4368+
{
4369+
"name": group.encode(),
4370+
"consumers": 0,
4371+
"pending": 0,
4372+
"last-delivered-id": b"0-0",
4373+
"entries-read": 7,
4374+
"lag": 1,
4375+
}
4376+
]
4377+
assert r.xinfo_groups(stream) == expected
4378+
43534379
@skip_if_server_version_lt("5.0.0")
43544380
def test_xgroup_delconsumer(self, r):
43554381
stream = "stream"

‎tests/test_helpers.py

-35
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
delist,
55
list_or_args,
66
nativestr,
7-
parse_to_dict,
87
parse_to_list,
98
quote_string,
109
random_string,
@@ -26,40 +25,6 @@ def test_parse_to_list():
2625
assert parse_to_list(r) == ["hello", "my name", 45, 555.55, "is simon!", None]
2726

2827

29-
def test_parse_to_dict():
30-
assert parse_to_dict(None) == {}
31-
r = [
32-
["Some number", "1.0345"],
33-
["Some string", "hello"],
34-
[
35-
"Child iterators",
36-
[
37-
"Time",
38-
"0.2089",
39-
"Counter",
40-
3,
41-
"Child iterators",
42-
["Type", "bar", "Time", "0.0729", "Counter", 3],
43-
["Type", "barbar", "Time", "0.058", "Counter", 3],
44-
["Type", "barbarbar", "Time", "0.0234", "Counter", 3],
45-
],
46-
],
47-
]
48-
assert parse_to_dict(r) == {
49-
"Child iterators": {
50-
"Child iterators": [
51-
{"Counter": 3.0, "Time": 0.0729, "Type": "bar"},
52-
{"Counter": 3.0, "Time": 0.058, "Type": "barbar"},
53-
{"Counter": 3.0, "Time": 0.0234, "Type": "barbarbar"},
54-
],
55-
"Counter": 3.0,
56-
"Time": 0.2089,
57-
},
58-
"Some number": 1.0345,
59-
"Some string": "hello",
60-
}
61-
62-
6328
def test_nativestr():
6429
assert nativestr("teststr") == "teststr"
6530
assert nativestr(b"teststr") == "teststr"

‎tests/test_search.py

+124-25
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
TextField,
2121
VectorField,
2222
)
23-
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
23+
from redis.commands.search.index_definition import IndexDefinition, IndexType
2424
from redis.commands.search.query import GeoFilter, NumericFilter, Query
2525
from redis.commands.search.result import Result
2626
from redis.commands.search.suggestion import Suggestion
@@ -30,6 +30,7 @@
3030
is_resp2_connection,
3131
skip_if_redis_enterprise,
3232
skip_if_resp_version,
33+
skip_if_server_version_gte,
3334
skip_if_server_version_lt,
3435
skip_ifmodversion_lt,
3536
)
@@ -1007,6 +1008,7 @@ def test_get(client):
10071008
@pytest.mark.redismod
10081009
@pytest.mark.onlynoncluster
10091010
@skip_ifmodversion_lt("2.2.0", "search")
1011+
@skip_if_server_version_gte("7.9.0")
10101012
def test_config(client):
10111013
assert client.ft().config_set("TIMEOUT", "100")
10121014
with pytest.raises(redis.ResponseError):
@@ -1017,6 +1019,19 @@ def test_config(client):
10171019
assert "100" == res["TIMEOUT"]
10181020

10191021

1022+
@pytest.mark.redismod
1023+
@pytest.mark.onlynoncluster
1024+
@skip_if_server_version_lt("7.9.0")
1025+
def test_config_with_removed_ftconfig(client):
1026+
assert client.config_set("timeout", "100")
1027+
with pytest.raises(redis.ResponseError):
1028+
client.config_set("timeout", "null")
1029+
res = client.config_get("*")
1030+
assert "100" == res["timeout"]
1031+
res = client.config_get("timeout")
1032+
assert "100" == res["timeout"]
1033+
1034+
10201035
@pytest.mark.redismod
10211036
@pytest.mark.onlynoncluster
10221037
def test_aggregations_groupby(client):
@@ -1571,6 +1586,7 @@ def test_index_definition(client):
15711586
@pytest.mark.redismod
15721587
@pytest.mark.onlynoncluster
15731588
@skip_if_redis_enterprise()
1589+
@skip_if_server_version_gte("7.9.0")
15741590
def test_expire(client):
15751591
client.ft().create_index((TextField("txt", sortable=True),), temporary=4)
15761592
ttl = client.execute_command("ft.debug", "TTL", "idx")
@@ -2025,6 +2041,8 @@ def test_json_with_jsonpath(client):
20252041
@pytest.mark.redismod
20262042
@pytest.mark.onlynoncluster
20272043
@skip_if_redis_enterprise()
2044+
@skip_if_server_version_gte("7.9.0")
2045+
@skip_if_server_version_lt("6.3.0")
20282046
def test_profile(client):
20292047
client.ft().create_index((TextField("t"),))
20302048
client.ft().client.hset("1", "t", "hello")
@@ -2034,10 +2052,9 @@ def test_profile(client):
20342052
q = Query("hello|world").no_content()
20352053
if is_resp2_connection(client):
20362054
res, det = client.ft().profile(q)
2037-
assert det["Iterators profile"]["Counter"] == 2.0
2038-
assert len(det["Iterators profile"]["Child iterators"]) == 2
2039-
assert det["Iterators profile"]["Type"] == "UNION"
2040-
assert det["Parsing time"] < 0.5
2055+
det = det.info
2056+
2057+
assert isinstance(det, list)
20412058
assert len(res.docs) == 2 # check also the search result
20422059

20432060
# check using AggregateRequest
@@ -2047,15 +2064,14 @@ def test_profile(client):
20472064
.apply(prefix="startswith(@t, 'hel')")
20482065
)
20492066
res, det = client.ft().profile(req)
2050-
assert det["Iterators profile"]["Counter"] == 2
2051-
assert det["Iterators profile"]["Type"] == "WILDCARD"
2052-
assert isinstance(det["Parsing time"], float)
2067+
det = det.info
2068+
assert isinstance(det, list)
20532069
assert len(res.rows) == 2 # check also the search result
20542070
else:
20552071
res = client.ft().profile(q)
2056-
assert res["profile"]["Iterators profile"][0]["Counter"] == 2.0
2057-
assert res["profile"]["Iterators profile"][0]["Type"] == "UNION"
2058-
assert res["profile"]["Parsing time"] < 0.5
2072+
res = res.info
2073+
2074+
assert isinstance(res, dict)
20592075
assert len(res["results"]) == 2 # check also the search result
20602076

20612077
# check using AggregateRequest
@@ -2065,14 +2081,97 @@ def test_profile(client):
20652081
.apply(prefix="startswith(@t, 'hel')")
20662082
)
20672083
res = client.ft().profile(req)
2068-
assert res["profile"]["Iterators profile"][0]["Counter"] == 2
2069-
assert res["profile"]["Iterators profile"][0]["Type"] == "WILDCARD"
2070-
assert isinstance(res["profile"]["Parsing time"], float)
2084+
res = res.info
2085+
2086+
assert isinstance(res, dict)
20712087
assert len(res["results"]) == 2 # check also the search result
20722088

20732089

20742090
@pytest.mark.redismod
20752091
@pytest.mark.onlynoncluster
2092+
@skip_if_redis_enterprise()
2093+
@skip_if_server_version_lt("7.9.0")
2094+
def test_profile_with_coordinator(client):
2095+
client.ft().create_index((TextField("t"),))
2096+
client.ft().client.hset("1", "t", "hello")
2097+
client.ft().client.hset("2", "t", "world")
2098+
2099+
# check using Query
2100+
q = Query("hello|world").no_content()
2101+
if is_resp2_connection(client):
2102+
res, det = client.ft().profile(q)
2103+
det = det.info
2104+
2105+
assert isinstance(det, list)
2106+
assert len(res.docs) == 2 # check also the search result
2107+
2108+
# check using AggregateRequest
2109+
req = (
2110+
aggregations.AggregateRequest("*")
2111+
.load("t")
2112+
.apply(prefix="startswith(@t, 'hel')")
2113+
)
2114+
res, det = client.ft().profile(req)
2115+
det = det.info
2116+
2117+
assert isinstance(det, list)
2118+
assert det[0] == "Shards"
2119+
assert det[2] == "Coordinator"
2120+
assert len(res.rows) == 2 # check also the search result
2121+
else:
2122+
res = client.ft().profile(q)
2123+
res = res.info
2124+
2125+
assert isinstance(res, dict)
2126+
assert len(res["Results"]["results"]) == 2 # check also the search result
2127+
2128+
# check using AggregateRequest
2129+
req = (
2130+
aggregations.AggregateRequest("*")
2131+
.load("t")
2132+
.apply(prefix="startswith(@t, 'hel')")
2133+
)
2134+
res = client.ft().profile(req)
2135+
res = res.info
2136+
2137+
assert isinstance(res, dict)
2138+
assert len(res["Results"]["results"]) == 2 # check also the search result
2139+
2140+
2141+
@pytest.mark.redismod
2142+
@pytest.mark.onlynoncluster
2143+
@skip_if_redis_enterprise()
2144+
@skip_if_server_version_gte("6.3.0")
2145+
def test_profile_with_no_warnings(client):
2146+
client.ft().create_index((TextField("t"),))
2147+
client.ft().client.hset("1", "t", "hello")
2148+
client.ft().client.hset("2", "t", "world")
2149+
2150+
# check using Query
2151+
q = Query("hello|world").no_content()
2152+
res, det = client.ft().profile(q)
2153+
det = det.info
2154+
2155+
assert isinstance(det, list)
2156+
assert len(res.docs) == 2 # check also the search result
2157+
2158+
# check using AggregateRequest
2159+
req = (
2160+
aggregations.AggregateRequest("*")
2161+
.load("t")
2162+
.apply(prefix="startswith(@t, 'hel')")
2163+
)
2164+
res, det = client.ft().profile(req)
2165+
det = det.info
2166+
2167+
assert isinstance(det, list)
2168+
assert len(res.rows) == 2 # check also the search result
2169+
2170+
2171+
@pytest.mark.redismod
2172+
@pytest.mark.onlynoncluster
2173+
@skip_if_server_version_gte("7.9.0")
2174+
@skip_if_server_version_lt("6.3.0")
20762175
def test_profile_limited(client):
20772176
client.ft().create_index((TextField("t"),))
20782177
client.ft().client.hset("1", "t", "hello")
@@ -2083,18 +2182,14 @@ def test_profile_limited(client):
20832182
q = Query("%hell% hel*")
20842183
if is_resp2_connection(client):
20852184
res, det = client.ft().profile(q, limited=True)
2086-
assert (
2087-
det["Iterators profile"]["Child iterators"][0]["Child iterators"]
2088-
== "The number of iterators in the union is 3"
2089-
)
2090-
assert (
2091-
det["Iterators profile"]["Child iterators"][1]["Child iterators"]
2092-
== "The number of iterators in the union is 4"
2093-
)
2094-
assert det["Iterators profile"]["Type"] == "INTERSECT"
2185+
det = det.info
2186+
assert det[4][1][7][9] == "The number of iterators in the union is 3"
2187+
assert det[4][1][8][9] == "The number of iterators in the union is 4"
2188+
assert det[4][1][1] == "INTERSECT"
20952189
assert len(res.docs) == 3 # check also the search result
20962190
else:
20972191
res = client.ft().profile(q, limited=True)
2192+
res = res.info
20982193
iterators_profile = res["profile"]["Iterators profile"]
20992194
assert (
21002195
iterators_profile[0]["Child iterators"][0]["Child iterators"]
@@ -2110,6 +2205,8 @@ def test_profile_limited(client):
21102205

21112206
@pytest.mark.redismod
21122207
@skip_ifmodversion_lt("2.4.3", "search")
2208+
@skip_if_server_version_gte("7.9.0")
2209+
@skip_if_server_version_lt("6.3.0")
21132210
def test_profile_query_params(client):
21142211
client.ft().create_index(
21152212
(
@@ -2125,13 +2222,15 @@ def test_profile_query_params(client):
21252222
q = Query(query).return_field("__v_score").sort_by("__v_score", True)
21262223
if is_resp2_connection(client):
21272224
res, det = client.ft().profile(q, query_params={"vec": "aaaaaaaa"})
2128-
assert det["Iterators profile"]["Counter"] == 2.0
2129-
assert det["Iterators profile"]["Type"] == "VECTOR"
2225+
det = det.info
2226+
assert det[4][1][5] == 2.0
2227+
assert det[4][1][1] == "VECTOR"
21302228
assert res.total == 2
21312229
assert "a" == res.docs[0].id
21322230
assert "0" == res.docs[0].__getattribute__("__v_score")
21332231
else:
21342232
res = client.ft().profile(q, query_params={"vec": "aaaaaaaa"})
2233+
res = res.info
21352234
assert res["profile"]["Iterators profile"][0]["Counter"] == 2
21362235
assert res["profile"]["Iterators profile"][0]["Type"] == "VECTOR"
21372236
assert res["total_results"] == 2

0 commit comments

Comments
 (0)
Please sign in to comment.