qdrant-haystack 8.0.0__py3-none-any.whl → 9.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of qdrant-haystack might be problematic. Click here for more details.

@@ -1,7 +1,7 @@
1
- import logging
2
1
  import uuid
3
2
  from typing import List, Union
4
3
 
4
+ from haystack import logging
5
5
  from haystack.dataclasses import Document
6
6
  from qdrant_client.http import models as rest
7
7
 
@@ -23,14 +23,6 @@ def convert_haystack_documents_to_qdrant_points(
23
23
  for document in documents:
24
24
  payload = document.to_dict(flatten=False)
25
25
 
26
- if payload.pop("dataframe", None):
27
- logger.warning(
28
- "Document %s has the `dataframe` field set,"
29
- "QdrantDocumentStore no longer supports dataframes and this field will be ignored. "
30
- "The `dataframe` field will soon be removed from Haystack Document.",
31
- document.id,
32
- )
33
-
34
26
  if use_sparse_embeddings:
35
27
  vector = {}
36
28
 
@@ -73,14 +65,6 @@ def convert_qdrant_point_to_haystack_document(point: QdrantPoint, use_sparse_emb
73
65
  payload = {**point.payload}
74
66
  payload["score"] = point.score if hasattr(point, "score") else None
75
67
 
76
- if payload.pop("dataframe", None):
77
- logger.warning(
78
- "Document %s has the `dataframe` field set,"
79
- "QdrantDocumentStore no longer supports dataframes and this field will be ignored. "
80
- "The `dataframe` field will soon be removed from Haystack Document.",
81
- payload["id"],
82
- )
83
-
84
68
  if not use_sparse_embeddings:
85
69
  payload["embedding"] = point.vector if hasattr(point, "vector") else None
86
70
  elif hasattr(point, "vector") and point.vector is not None:
@@ -1,11 +1,10 @@
1
1
  import inspect
2
- import logging
3
2
  from itertools import islice
4
3
  from typing import Any, ClassVar, Dict, Generator, List, Optional, Set, Union
5
4
 
6
5
  import numpy as np
7
6
  import qdrant_client
8
- from haystack import default_from_dict, default_to_dict
7
+ from haystack import default_from_dict, default_to_dict, logging
9
8
  from haystack.dataclasses import Document
10
9
  from haystack.dataclasses.sparse_embedding import SparseEmbedding
11
10
  from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError
@@ -48,8 +47,8 @@ def get_batches_from_generator(iterable, n):
48
47
 
49
48
  class QdrantDocumentStore:
50
49
  """
51
- QdrantDocumentStore is a Document Store for Qdrant.
52
- It can be used with any Qdrant instance: in-memory, disk-persisted, Docker-based,
50
+ A QdrantDocumentStore implementation that you
51
+ can use with any Qdrant instance: in-memory, disk-persisted, Docker-based,
53
52
  and Qdrant Cloud Cluster deployments.
54
53
 
55
54
  Usage example by creating an in-memory instance:
@@ -866,10 +865,18 @@ class QdrantDocumentStore:
866
865
 
867
866
  collection_info = self.client.get_collection(collection_name)
868
867
 
869
- has_named_vectors = (
870
- isinstance(collection_info.config.params.vectors, dict)
871
- and DENSE_VECTORS_NAME in collection_info.config.params.vectors
872
- )
868
+ has_named_vectors = isinstance(collection_info.config.params.vectors, dict)
869
+
870
+ if has_named_vectors and DENSE_VECTORS_NAME not in collection_info.config.params.vectors:
871
+ msg = (
872
+ f"Collection '{collection_name}' already exists in Qdrant, "
873
+ f"but it has been originally created outside of Haystack and is not supported. "
874
+ f"If possible, you should create a new Document Store with Haystack. "
875
+ f"In case you want to migrate the existing collection, see an example script in "
876
+ f"https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/qdrant/src/"
877
+ f"haystack_integrations/document_stores/qdrant/migrate_to_sparse.py."
878
+ )
879
+ raise QdrantStoreError(msg)
873
880
 
874
881
  if self.use_sparse_embeddings and not has_named_vectors:
875
882
  msg = (
@@ -882,7 +889,7 @@ class QdrantDocumentStore:
882
889
  )
883
890
  raise QdrantStoreError(msg)
884
891
 
885
- elif not self.use_sparse_embeddings and has_named_vectors:
892
+ if not self.use_sparse_embeddings and has_named_vectors:
886
893
  msg = (
887
894
  f"Collection '{collection_name}' already exists in Qdrant, "
888
895
  f"but it has been originally created with sparse embedding vectors."
@@ -1,13 +1,14 @@
1
- import logging
1
+ import logging as python_logging
2
2
  import time
3
3
 
4
+ from haystack import logging
4
5
  from qdrant_client.http import models
5
6
 
6
7
  from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
7
8
 
8
9
  logger = logging.getLogger(__name__)
9
- logger.addHandler(logging.StreamHandler())
10
- logger.setLevel(logging.INFO)
10
+ logger.addHandler(python_logging.StreamHandler())
11
+ logger.setLevel(python_logging.INFO)
11
12
 
12
13
 
13
14
  def migrate_to_sparse_embeddings_support(old_document_store: QdrantDocumentStore, new_index: str):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qdrant-haystack
3
- Version: 8.0.0
3
+ Version: 9.0.0
4
4
  Summary: An integration of Qdrant ANN vector database backend with Haystack
5
5
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
6
6
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/qdrant/README.md
@@ -11,14 +11,14 @@ License-File: LICENSE.txt
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3.8
15
14
  Classifier: Programming Language :: Python :: 3.9
16
15
  Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: Implementation :: CPython
19
19
  Classifier: Programming Language :: Python :: Implementation :: PyPy
20
- Requires-Python: >=3.8
21
- Requires-Dist: haystack-ai
20
+ Requires-Python: >=3.9
21
+ Requires-Dist: haystack-ai>=2.11.0
22
22
  Requires-Dist: qdrant-client>=1.10.0
23
23
  Description-Content-Type: text/markdown
24
24
 
@@ -1,11 +1,11 @@
1
1
  haystack_integrations/components/retrievers/qdrant/__init__.py,sha256=AE1hdw4sqb0rTSqfAxKCRUOZVE8gbHdQ1wDccdN86hc,313
2
2
  haystack_integrations/components/retrievers/qdrant/retriever.py,sha256=VsQVsvf79imTCdWUKikUxpjczl5oxOV64a91aGXZwpE,21997
3
3
  haystack_integrations/document_stores/qdrant/__init__.py,sha256=kUGc5uewqArhmVR-JqB_NmJ4kNkTIQIvYDNSoO2ELn0,302
4
- haystack_integrations/document_stores/qdrant/converters.py,sha256=ndFZjMjweJJDyC_994zDX4BGhGcW1SfLf79zBeyUits,3192
5
- haystack_integrations/document_stores/qdrant/document_store.py,sha256=pcVuU9pNdjwROISG19vaj2Zpkl4_N2k_3UOi2XO7b00,42246
4
+ haystack_integrations/document_stores/qdrant/converters.py,sha256=iVhAZ7wdRxRjfLVMHB1JdAhn7LpU5bwza1obGmEePWU,2506
5
+ haystack_integrations/document_stores/qdrant/document_store.py,sha256=Ym7pFQOAw-cxb4dv6JIgfeIhw5cp_Mivj9eKfPsvs-8,42854
6
6
  haystack_integrations/document_stores/qdrant/filters.py,sha256=Nv_eKIYKwUWvldJfa0omfFQ0kgqi6L3DUFeMuIWziOY,11751
7
- haystack_integrations/document_stores/qdrant/migrate_to_sparse.py,sha256=yhZr4GB6N1S-Ikzl52hpuZt2aHNIb4leqFDhVMU3Uho,4910
8
- qdrant_haystack-8.0.0.dist-info/METADATA,sha256=PorUoQRLkK0yhoMEifdBakszFFneNjT7KEkKIxvJ6Fg,1863
9
- qdrant_haystack-8.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- qdrant_haystack-8.0.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
11
- qdrant_haystack-8.0.0.dist-info/RECORD,,
7
+ haystack_integrations/document_stores/qdrant/migrate_to_sparse.py,sha256=2xyet1fhy2lpVTs3E75f7oR521zcjT6U2jHd4pLLgKM,4971
8
+ qdrant_haystack-9.0.0.dist-info/METADATA,sha256=f7P4nD4mHWZ-NJNxalq83tw5GmmYfLGZ-l_6e-TAZas,1872
9
+ qdrant_haystack-9.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ qdrant_haystack-9.0.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
11
+ qdrant_haystack-9.0.0.dist-info/RECORD,,