Skip to content

Commit

Permalink
chore: update qdrant to v0.7.0 (#273)
Browse files Browse the repository at this point in the history
* chore: update qdrant to v0.7.0

* chore: apply black
  • Loading branch information
generall authored Apr 13, 2022
1 parent 679bf84 commit 8c518b3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
8 changes: 3 additions & 5 deletions docarray/array/storage/qdrant/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@ def __setstate__(self, state):
def _get_offset2ids_meta(self) -> List[str]:
if not self._collection_exists(self.collection_name_meta):
return []
return (
self.client.http.points_api.get_point(self.collection_name_meta, id=1)
.result.payload['offset2id']
.value
)
return self.client.http.points_api.get_point(
self.collection_name_meta, id=1
).result.payload['offset2id']

def _update_offset2ids_meta(self):
if not self._collection_exists(self.collection_name_meta):
Expand Down
4 changes: 2 additions & 2 deletions docarray/array/storage/qdrant/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
List,
)

from qdrant_openapi_client.models.models import Distance
from qdrant_client.http.models.models import Distance

from .... import Document, DocumentArray
from ....math import ndarray
Expand Down Expand Up @@ -64,7 +64,7 @@ def _find_similar_vectors(self, q: 'QdrantArrayType', limit=10):

for hit in search_result:
doc = Document.from_base64(
hit.payload['_serialized'].value[0], **self.serialize_config
hit.payload['_serialized'], **self.serialize_config
)
doc.scores[f'{self.distance.lower()}_similarity'] = NamedScore(
value=hit.score
Expand Down
6 changes: 3 additions & 3 deletions docarray/array/storage/qdrant/getsetdel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from typing import Iterable, Iterator

from qdrant_client import QdrantClient
from qdrant_openapi_client.exceptions import UnexpectedResponse
from qdrant_openapi_client.models.models import (
from qdrant_client.http.exceptions import UnexpectedResponse
from qdrant_client.http.models.models import (
PointIdsList,
PointsList,
ScrollRequest,
Expand Down Expand Up @@ -61,7 +61,7 @@ def _upload_batch(self, docs: Iterable['Document']):

def _qdrant_to_document(self, qdrant_record: dict) -> 'Document':
return Document.from_base64(
qdrant_record['_serialized'].value[0], **self.serialization_config
qdrant_record['_serialized'], **self.serialization_config
)

def _document_to_qdrant(self, doc: 'Document') -> 'PointStruct':
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/document-store/qdrant.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ server. Create `docker-compose.yml` as follows:
version: '3.4'
services:
qdrant:
image: qdrant/qdrant:v0.6.0
image: qdrant/qdrant:v0.7.0
ports:
- "6333:6333"
ulimits: # Only required for tests, as there are a lot of collections created
Expand Down Expand Up @@ -84,7 +84,7 @@ Create `docker-compose.yml`:
version: '3.4'
services:
qdrant:
image: qdrant/qdrant:v0.6.0
image: qdrant/qdrant:v0.7.0
ports:
- "6333:6333"
ulimits: # Only required for tests, as there are a lot of collections created
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
'uvicorn',
'weaviate-client~=3.3.0',
'annlite>=0.3.0',
'qdrant-client~=0.6.0',
'qdrant-client~=0.7.0',
'strawberry-graphql',
'elasticsearch>=8.0.1',
],
'qdrant': [
'qdrant-client~=0.6.0',
'qdrant-client~=0.7.0',
],
'test': [
'pytest',
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/array/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
qdrant:
image: qdrant/qdrant:v0.6.0
image: qdrant/qdrant:v0.7.0
ports:
- "6333:6333"
ulimits: # Only required for tests, as there are a lot of collections created
Expand Down

0 comments on commit 8c518b3

Please sign in to comment.