|
11 | 11 | from haystack.document_stores.types import DuplicatePolicy |
12 | 12 | from haystack.utils import Secret, deserialize_secrets_inplace |
13 | 13 | from numpy import exp |
14 | | -from qdrant_client import grpc |
15 | 14 | from qdrant_client.http import models as rest |
16 | 15 | from qdrant_client.http.exceptions import UnexpectedResponse |
17 | 16 | from tqdm import tqdm |
@@ -128,7 +127,6 @@ def __init__( |
128 | 127 | optimizers_config: Optional[dict] = None, |
129 | 128 | wal_config: Optional[dict] = None, |
130 | 129 | quantization_config: Optional[dict] = None, |
131 | | - init_from: Optional[dict] = None, |
132 | 130 | wait_result_from_api: bool = True, |
133 | 131 | metadata: Optional[dict] = None, |
134 | 132 | write_batch_size: int = 100, |
@@ -210,8 +208,6 @@ def __init__( |
210 | 208 | Params for Write-Ahead-Log. |
211 | 209 | :param quantization_config: |
212 | 210 | Params for quantization. If `None`, quantization will be disabled. |
213 | | - :param init_from: |
214 | | - Use data stored in another collection to initialize this collection. |
215 | 211 | :param wait_result_from_api: |
216 | 212 | Whether to wait for the result from the API after each request. |
217 | 213 | :param metadata: |
@@ -251,7 +247,6 @@ def __init__( |
251 | 247 | self.optimizers_config = optimizers_config |
252 | 248 | self.wal_config = wal_config |
253 | 249 | self.quantization_config = quantization_config |
254 | | - self.init_from = init_from |
255 | 250 | self.wait_result_from_api = wait_result_from_api |
256 | 251 | self.recreate_index = recreate_index |
257 | 252 | self.payload_fields_to_index = payload_fields_to_index |
@@ -685,8 +680,11 @@ def _get_documents_generator( |
685 | 680 | with_vectors=True, |
686 | 681 | ) |
687 | 682 | stop_scrolling = next_offset is None or ( |
688 | | - isinstance(next_offset, grpc.PointId) and next_offset.num == 0 and next_offset.uuid == "" # type: ignore[union-attr] |
689 | | - ) # grpc.PointId always has num and uuid |
| 683 | + hasattr(next_offset, "num") |
| 684 | + and hasattr(next_offset, "uuid") |
| 685 | + and next_offset.num == 0 |
| 686 | + and next_offset.uuid == "" |
| 687 | + ) # PointId always has num and uuid |
690 | 688 |
|
691 | 689 | for record in records: |
692 | 690 | yield convert_qdrant_point_to_haystack_document( |
@@ -722,8 +720,11 @@ async def _get_documents_generator_async( |
722 | 720 | with_vectors=True, |
723 | 721 | ) |
724 | 722 | stop_scrolling = next_offset is None or ( |
725 | | - isinstance(next_offset, grpc.PointId) and next_offset.num == 0 and next_offset.uuid == "" # type: ignore[union-attr] |
726 | | - ) # grpc.PointId always has num and uuid |
| 723 | + hasattr(next_offset, "num") |
| 724 | + and hasattr(next_offset, "uuid") |
| 725 | + and next_offset.num == 0 |
| 726 | + and next_offset.uuid == "" |
| 727 | + ) # PointId always has num and uuid |
727 | 728 |
|
728 | 729 | for record in records: |
729 | 730 | yield convert_qdrant_point_to_haystack_document( |
@@ -1644,7 +1645,6 @@ def _prepare_collection_params(self) -> dict[str, Any]: |
1644 | 1645 | "optimizers_config": self.optimizers_config, |
1645 | 1646 | "wal_config": self.wal_config, |
1646 | 1647 | "quantization_config": self.quantization_config, |
1647 | | - "init_from": self.init_from, |
1648 | 1648 | } |
1649 | 1649 |
|
1650 | 1650 | def _prepare_client_params(self) -> dict[str, Any]: |
|
0 commit comments