Skip to content

Commit 0ce5ca0

Browse files
generalljoein
andcommitted
do not use vectors_count in test and in local mode (#600)
* do not use vectors_count in test and in local mode * fix: remove indexed vectors count comparison in sparse vector tests * tests: return tests for full snapshot, increase timeout --------- Co-authored-by: George Panchuk <[email protected]>
1 parent a7a798c commit 0ce5ca0

File tree

4 files changed

+10
-31
lines changed

4 files changed

+10
-31
lines changed

qdrant_client/local/local_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ def info(self) -> models.CollectionInfo:
15991599
return models.CollectionInfo(
16001600
status=models.CollectionStatus.GREEN,
16011601
optimizer_status=models.OptimizersStatusOneOf.OK,
1602-
vectors_count=self.count().count * len(self.vectors),
1602+
vectors_count=None,
16031603
indexed_vectors_count=0, # LocalCollection does not do indexing
16041604
points_count=self.count().count,
16051605
segments_count=1,

tests/congruence_tests/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def compare_collections(
122122
client_1,
123123
client_2,
124124
num_vectors,
125-
attrs=("vectors_count", "indexed_vectors_count", "points_count"),
125+
attrs=("indexed_vectors_count", "points_count"),
126126
collection_name: str = COLLECTION_NAME,
127127
):
128128
collection_1 = client_1.get_collection(collection_name)

tests/congruence_tests/test_sparse_updates.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ def test_upsert():
9292
local_client,
9393
remote_client,
9494
UPLOAD_NUM_VECTORS,
95-
attrs=(
96-
"points_count",
97-
"vectors_count",
98-
),
95+
attrs=("points_count",),
9996
)
10097

10198

@@ -122,10 +119,7 @@ def test_upload_collection():
122119
local_client,
123120
remote_client,
124121
UPLOAD_NUM_VECTORS,
125-
attrs=(
126-
"points_count",
127-
"vectors_count",
128-
),
122+
attrs=("points_count",),
129123
)
130124

131125

@@ -155,10 +149,7 @@ def test_upload_collection_generators():
155149
local_client,
156150
remote_client,
157151
UPLOAD_NUM_VECTORS,
158-
attrs=(
159-
"points_count",
160-
"vectors_count",
161-
),
152+
attrs=("points_count",),
162153
)
163154

164155

@@ -178,10 +169,7 @@ def test_upload_points():
178169
local_client,
179170
remote_client,
180171
UPLOAD_NUM_VECTORS,
181-
attrs=(
182-
"points_count",
183-
"vectors_count",
184-
),
172+
attrs=("points_count",),
185173
)
186174

187175

@@ -213,8 +201,5 @@ def test_upload_uuid_in_batches():
213201
local_client,
214202
remote_client,
215203
UPLOAD_NUM_VECTORS,
216-
attrs=(
217-
"points_count",
218-
"vectors_count",
219-
),
204+
attrs=("points_count",),
220205
)

tests/test_async_qdrant_client.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def test_async_grpc():
9797
@pytest.mark.parametrize("prefer_grpc", [True, False])
9898
async def test_async_qdrant_client(prefer_grpc):
9999
version = os.getenv("QDRANT_VERSION")
100-
client = AsyncQdrantClient(prefer_grpc=prefer_grpc)
100+
client = AsyncQdrantClient(prefer_grpc=prefer_grpc, timeout=15)
101101
collection_params = dict(
102102
collection_name=COLLECTION_NAME,
103103
vectors_config=models.VectorParams(size=10, distance=models.Distance.EUCLID),
@@ -244,21 +244,15 @@ async def test_async_qdrant_client(prefer_grpc):
244244
# await client.recover_snapshot(collection_name=COLLECTION_NAME, location=...)
245245
# assert (await client.get_collection(COLLECTION_NAME)).vectors_count == 100
246246

247-
await client.delete_snapshot(COLLECTION_NAME, snapshot_name=snapshots[0].name)
248-
time.sleep(
249-
0.5
250-
) # wait param is not propagated https://github.com/qdrant/qdrant-client/issues/254
247+
await client.delete_snapshot(COLLECTION_NAME, snapshot_name=snapshots[0].name, wait=True)
251248

252249
assert len(await client.list_snapshots(COLLECTION_NAME)) == 0
253250

254251
assert isinstance(await client.create_full_snapshot(), models.SnapshotDescription)
255252
snapshots = await client.list_full_snapshots()
256253
assert len(snapshots) == 1
257254

258-
await client.delete_full_snapshot(snapshot_name=snapshots[0].name)
259-
time.sleep(
260-
0.5
261-
) # wait param is not propagated https://github.com/qdrant/qdrant-client/issues/254
255+
await client.delete_full_snapshot(snapshot_name=snapshots[0].name, wait=True)
262256

263257
assert len(await client.list_full_snapshots()) == 0
264258

0 commit comments

Comments
 (0)