Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change upload points async #730

Merged
merged 4 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qdrant_client/async_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def upload_records(
) -> None:
raise NotImplementedError()

async def upload_points(
def upload_points(
self, collection_name: str, points: Iterable[types.PointStruct], **kwargs: Any
) -> None:
raise NotImplementedError()
Expand Down
4 changes: 2 additions & 2 deletions qdrant_client/async_qdrant_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,7 @@ def upload_records(
shard_key_selector=shard_key_selector,
)

async def upload_points(
def upload_points(
self,
collection_name: str,
points: Iterable[types.PointStruct],
Expand Down Expand Up @@ -2183,7 +2183,7 @@ async def upload_points(

"""
assert len(kwargs) == 0, f"Unknown arguments: {list(kwargs.keys())}"
return await self._client.upload_points(
return self._client.upload_points(
collection_name=collection_name,
points=points,
batch_size=batch_size,
Expand Down
2 changes: 1 addition & 1 deletion qdrant_client/async_qdrant_fastembed.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ async def add(
ids_accumulator=inserted_ids,
sparse_vectors=encoded_sparse_docs,
)
await self.upload_points(
self.upload_points(
collection_name=collection_name,
points=points,
wait=True,
Expand Down
2 changes: 1 addition & 1 deletion qdrant_client/async_qdrant_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,7 @@ def upload_records(
wait=wait,
)

async def upload_points(
def upload_points(
self,
collection_name: str,
points: Iterable[types.PointStruct],
Expand Down
2 changes: 1 addition & 1 deletion qdrant_client/local/async_qdrant_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ async def recreate_collection(
collection_name, vectors_config, init_from, sparse_vectors_config
)

async def upload_points(
def upload_points(
self, collection_name: str, points: Iterable[types.PointStruct], **kwargs: Any
) -> None:
self._upload_points(collection_name, points)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_async_qdrant_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import os
import random
import time

Expand Down Expand Up @@ -35,7 +34,7 @@ async def test_async_grpc():
for idx in range(NUM_VECTORS)
)

client = QdrantClient(prefer_grpc=True, timeout=3.0)
client = QdrantClient(prefer_grpc=True, timeout=3)

grpc_collections = client.async_grpc_collections

Expand Down
2 changes: 1 addition & 1 deletion tools/async_client_generator/base_client_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(

# Parse the code into an AST
base_client_generator = BaseClientGenerator(
keep_sync=["__init__", "upload_records", "upload_collection", "migrate"],
keep_sync=["__init__", "upload_records", "upload_collection", "upload_points", "migrate"],
class_replace_map={"QdrantBase": "AsyncQdrantBase"},
constant_replace_map={"QdrantBase": "AsyncQdrantBase"},
)
Expand Down
Loading