Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from haystack.document_stores.types import DuplicatePolicy
from haystack.utils import Secret, deserialize_secrets_inplace
from numpy import exp
from qdrant_client import grpc
from qdrant_client.http import models as rest
from qdrant_client.http.exceptions import UnexpectedResponse
from tqdm import tqdm
Expand Down Expand Up @@ -128,7 +127,6 @@ def __init__(
optimizers_config: Optional[dict] = None,
wal_config: Optional[dict] = None,
quantization_config: Optional[dict] = None,
init_from: Optional[dict] = None,
wait_result_from_api: bool = True,
metadata: Optional[dict] = None,
write_batch_size: int = 100,
Expand Down Expand Up @@ -210,8 +208,6 @@ def __init__(
Params for Write-Ahead-Log.
:param quantization_config:
Params for quantization. If `None`, quantization will be disabled.
:param init_from:
Use data stored in another collection to initialize this collection.
:param wait_result_from_api:
Whether to wait for the result from the API after each request.
:param metadata:
Expand Down Expand Up @@ -251,7 +247,6 @@ def __init__(
self.optimizers_config = optimizers_config
self.wal_config = wal_config
self.quantization_config = quantization_config
self.init_from = init_from
self.wait_result_from_api = wait_result_from_api
self.recreate_index = recreate_index
self.payload_fields_to_index = payload_fields_to_index
Expand Down Expand Up @@ -685,8 +680,11 @@ def _get_documents_generator(
with_vectors=True,
)
stop_scrolling = next_offset is None or (
isinstance(next_offset, grpc.PointId) and next_offset.num == 0 and next_offset.uuid == "" # type: ignore[union-attr]
) # grpc.PointId always has num and uuid
hasattr(next_offset, "num")
and hasattr(next_offset, "uuid")
and next_offset.num == 0
and next_offset.uuid == ""
) # PointId always has num and uuid

for record in records:
yield convert_qdrant_point_to_haystack_document(
Expand Down Expand Up @@ -722,8 +720,11 @@ async def _get_documents_generator_async(
with_vectors=True,
)
stop_scrolling = next_offset is None or (
isinstance(next_offset, grpc.PointId) and next_offset.num == 0 and next_offset.uuid == "" # type: ignore[union-attr]
) # grpc.PointId always has num and uuid
hasattr(next_offset, "num")
and hasattr(next_offset, "uuid")
and next_offset.num == 0
and next_offset.uuid == ""
) # PointId always has num and uuid

for record in records:
yield convert_qdrant_point_to_haystack_document(
Expand Down Expand Up @@ -1644,7 +1645,6 @@ def _prepare_collection_params(self) -> dict[str, Any]:
"optimizers_config": self.optimizers_config,
"wal_config": self.wal_config,
"quantization_config": self.quantization_config,
"init_from": self.init_from,
}

def _prepare_client_params(self) -> dict[str, Any]:
Expand Down
3 changes: 0 additions & 3 deletions integrations/qdrant/tests/test_dict_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_to_dict():
"optimizers_config": None,
"wal_config": None,
"quantization_config": None,
"init_from": None,
"wait_result_from_api": True,
"metadata": {},
"write_batch_size": 100,
Expand Down Expand Up @@ -69,7 +68,6 @@ def test_from_dict():
"recreate_index": True,
"shard_number": None,
"quantization_config": None,
"init_from": None,
"wait_result_from_api": True,
"metadata": {},
"write_batch_size": 1000,
Expand Down Expand Up @@ -98,7 +96,6 @@ def test_from_dict():
document_store.optimizers_config is None,
document_store.wal_config is None,
document_store.quantization_config is None,
document_store.init_from is None,
document_store.wait_result_from_api,
document_store.metadata == {},
document_store.write_batch_size == 1000,
Expand Down
1 change: 0 additions & 1 deletion integrations/qdrant/tests/test_document_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def test_to_dict(self, monkeypatch):
"optimizers_config": None,
"wal_config": None,
"quantization_config": None,
"init_from": None,
"wait_result_from_api": True,
"metadata": {},
"write_batch_size": 100,
Expand Down
1 change: 0 additions & 1 deletion integrations/qdrant/tests/test_embedding_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def test_to_dict(self):
"optimizers_config": None,
"wal_config": None,
"quantization_config": None,
"init_from": None,
"wait_result_from_api": True,
"metadata": {},
"write_batch_size": 100,
Expand Down
1 change: 0 additions & 1 deletion integrations/qdrant/tests/test_hybrid_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def test_to_dict(self):
"optimizers_config": None,
"wal_config": None,
"quantization_config": None,
"init_from": None,
"wait_result_from_api": True,
"metadata": {},
"write_batch_size": 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def test_to_dict(self):
"optimizers_config": None,
"wal_config": None,
"quantization_config": None,
"init_from": None,
"wait_result_from_api": True,
"metadata": {},
"write_batch_size": 100,
Expand Down