Skip to content

Commit b4713cd

Browse files
authored
Fix env installation (#1255)
* fix: update poetry lock * fix: add type annotations, update poetry.lock * fix: fix local persistence tests * fix: replace del client with client.close in local mode persistence tests * new: update local mode values count filter behaviour
1 parent 4dc996a commit b4713cd

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

‎qdrant_client/local/payload_filters.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_value_counts(values: list[Any]) -> list[int]:
2929

3030
def check_values_count(condition: models.ValuesCount, values: list[Any] | None) -> bool:
3131
if values is None:
32-
return False
32+
values = []
3333

3434
counts = get_value_counts(values)
3535

‎tests/congruence_tests/test_unflatten_values_methods.py‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,36 @@
1010
init_local,
1111
init_remote,
1212
)
13+
from tests.utils import read_version
14+
15+
16+
def qdrant_version_gte(required: tuple[int, int, int]) -> bool:
17+
major, minor, patch, dev = read_version()
18+
19+
# Treat dev as latest / compatible
20+
if dev:
21+
return True
22+
23+
# Do not skip when QDRANT_VERSION is not set
24+
if major is None or minor is None or patch is None:
25+
return True
26+
27+
return (major, minor, patch) >= required
28+
29+
30+
skip_absent_key_values_count = pytest.mark.skipif(
31+
not qdrant_version_gte((1, 18, 3)), # replace with actual required version
32+
reason="values_count for absent payload key requires Qdrant >= 1.18.3",
33+
)
1334

1435

1536
@pytest.mark.parametrize(
1637
"payloads,filter_params,payload_key",
1738
[
1839
# key is absent
19-
([{}], {"lte": 1}, "city"),
20-
([{}], {"lt": 1}, "city"),
21-
([None], {"lte": 1}, "city"),
40+
pytest.param([{}], {"lte": 1}, "city", marks=skip_absent_key_values_count),
41+
pytest.param([{}], {"lt": 1}, "city", marks=skip_absent_key_values_count),
42+
pytest.param([None], {"lte": 1}, "city", marks=skip_absent_key_values_count),
2243
# key is present, but value is None
2344
([{"city": None}], {"lt": 1}, "city"),
2445
([{"city": None}], {"gte": 1}, "city"),

0 commit comments

Comments
 (0)