chroma-haystack 2.0.1__tar.gz → 2.0.2__tar.gz

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.
Files changed (54) hide show
  1. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/CHANGELOG.md +17 -0
  2. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/PKG-INFO +5 -3
  3. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/pyproject.toml +3 -7
  4. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/document_store.py +16 -19
  5. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/tests/test_document_store.py +4 -4
  6. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/.gitignore +0 -0
  7. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/LICENSE +0 -0
  8. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/README.md +0 -0
  9. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_01.txt +0 -0
  10. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_02.txt +0 -0
  11. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_03.txt +0 -0
  12. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_04.txt +0 -0
  13. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_05.txt +0 -0
  14. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_06.txt +0 -0
  15. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_07.txt +0 -0
  16. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_08.txt +0 -0
  17. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_09.txt +0 -0
  18. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_10.txt +0 -0
  19. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_11.txt +0 -0
  20. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_12.txt +0 -0
  21. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_20.txt +0 -0
  22. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_21.txt +0 -0
  23. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_22.txt +0 -0
  24. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_23.txt +0 -0
  25. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_24.txt +0 -0
  26. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_25.txt +0 -0
  27. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_26.txt +0 -0
  28. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_27.txt +0 -0
  29. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_28.txt +0 -0
  30. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_29.txt +0 -0
  31. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_30.txt +0 -0
  32. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_31.txt +0 -0
  33. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_32.txt +0 -0
  34. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_40.txt +0 -0
  35. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_41.txt +0 -0
  36. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_42.txt +0 -0
  37. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_43.txt +0 -0
  38. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_44.txt +0 -0
  39. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_45.txt +0 -0
  40. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_46.txt +0 -0
  41. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_50.txt +0 -0
  42. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_51.txt +0 -0
  43. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_52.txt +0 -0
  44. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/data/usr_90.txt +0 -0
  45. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/example/example.py +0 -0
  46. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/pydoc/config.yml +0 -0
  47. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/components/retrievers/chroma/__init__.py +0 -0
  48. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/components/retrievers/chroma/retriever.py +0 -0
  49. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/__init__.py +0 -0
  50. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/errors.py +0 -0
  51. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/filters.py +0 -0
  52. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/src/haystack_integrations/document_stores/chroma/utils.py +0 -0
  53. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/tests/__init__.py +0 -0
  54. {chroma_haystack-2.0.1 → chroma_haystack-2.0.2}/tests/test_retriever.py +0 -0
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/chroma-v3.0.0] - 2025-03-11
4
+
5
+ ### 🧹 Chores
6
+
7
+ - Use Haystack logging across integrations (#1484)
8
+
9
+ ### 🌀 Miscellaneous
10
+
11
+ - Fix: Chroma - relax dataframe/blob test (#1404)
12
+ - Pin haystack and remove dataframe checks (#1501)
13
+
14
+ ## [integrations/chroma-v2.0.1] - 2025-02-14
15
+
16
+ ### 🌀 Miscellaneous
17
+
18
+ - Better handle discarded fields (#1373)
19
+
3
20
  ## [integrations/chroma-v1.0.1] - 2025-02-14
4
21
 
5
22
  ### 🧹 Chores
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chroma-haystack
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/chroma#readme
5
5
  Project-URL: Issues, https://github.com/deepset-ai/haystack-core-integrations/issues
6
6
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/chroma
@@ -13,11 +13,13 @@ Classifier: Programming Language :: Python
13
13
  Classifier: Programming Language :: Python :: 3.9
14
14
  Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
16
18
  Classifier: Programming Language :: Python :: Implementation :: CPython
17
19
  Classifier: Programming Language :: Python :: Implementation :: PyPy
18
20
  Requires-Python: >=3.9
19
- Requires-Dist: chromadb>=0.6.0
20
- Requires-Dist: haystack-ai
21
+ Requires-Dist: chromadb<1,>=0.6.0
22
+ Requires-Dist: haystack-ai>=2.11.0
21
23
  Description-Content-Type: text/markdown
22
24
 
23
25
  # Chroma Document Store for Haystack
@@ -18,13 +18,12 @@ classifiers = [
18
18
  "Programming Language :: Python :: 3.9",
19
19
  "Programming Language :: Python :: 3.10",
20
20
  "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
21
23
  "Programming Language :: Python :: Implementation :: CPython",
22
24
  "Programming Language :: Python :: Implementation :: PyPy",
23
25
  ]
24
- dependencies = [
25
- "haystack-ai",
26
- "chromadb>=0.6.0",
27
- ]
26
+ dependencies = ["haystack-ai>=2.11.0", "chromadb>=0.6.0,<1"]
28
27
 
29
28
  [project.urls]
30
29
  Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/chroma#readme"
@@ -60,9 +59,6 @@ cov = ["test-cov", "cov-report"]
60
59
  cov-retry = ["test-cov-retry", "cov-report"]
61
60
  docs = ["pydoc-markdown pydoc/config.yml"]
62
61
 
63
- [[tool.hatch.envs.all.matrix]]
64
- python = ["3.9", "3.10"]
65
-
66
62
  [tool.hatch.envs.lint]
67
63
  installer = "uv"
68
64
  detached = true
@@ -1,12 +1,11 @@
1
1
  # SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
- import logging
5
4
  from typing import Any, Dict, List, Literal, Optional
6
5
 
7
6
  import chromadb
8
7
  from chromadb.api.types import GetResult, QueryResult
9
- from haystack import default_from_dict, default_to_dict
8
+ from haystack import default_from_dict, default_to_dict, logging
10
9
  from haystack.dataclasses import Document
11
10
  from haystack.document_stores.types import DuplicatePolicy
12
11
  from numpy import ndarray
@@ -250,18 +249,16 @@ class ChromaDocumentStore:
250
249
  if doc.content is None:
251
250
  logger.warning(
252
251
  "ChromaDocumentStore cannot store documents with `content=None`. "
253
- "Document with id %s will be skipped.",
254
- doc.id,
252
+ "Document with id {doc_id} will be skipped.",
253
+ doc_id=doc.id,
255
254
  )
256
255
  continue
257
- elif (hasattr(doc, "dataframe") and doc.dataframe is not None) or (
258
- hasattr(doc, "blob") and doc.blob is not None
259
- ):
256
+ elif hasattr(doc, "blob") and doc.blob is not None:
260
257
  logger.warning(
261
- "Document with id %s contains `dataframe` or `blob` fields. "
262
- "ChromaDocumentStore cannot store `dataframe` or `blob` fields. "
263
- "These fields will be ignored. ",
264
- doc.id,
258
+ "Document with id {doc_id} contains the `blob` field. "
259
+ "ChromaDocumentStore cannot store `blob` fields. "
260
+ "This field will be ignored.",
261
+ doc_id=doc.id,
265
262
  )
266
263
  data = {"ids": [doc.id], "documents": [doc.content]}
267
264
 
@@ -277,11 +274,11 @@ class ChromaDocumentStore:
277
274
 
278
275
  if discarded_keys:
279
276
  logger.warning(
280
- "Document %s contains `meta` values of unsupported types for the keys: %s. "
281
- "These items will be discarded. Supported types are: %s.",
282
- doc.id,
283
- ", ".join(discarded_keys),
284
- ", ".join([t.__name__ for t in SUPPORTED_TYPES_FOR_METADATA_VALUES]),
277
+ "Document {doc_id} contains `meta` values of unsupported types for the keys: {keys}. "
278
+ "These items will be discarded. Supported types are: {types}.",
279
+ doc_id=doc.id,
280
+ keys=", ".join(discarded_keys),
281
+ types=", ".join([t.__name__ for t in SUPPORTED_TYPES_FOR_METADATA_VALUES]),
285
282
  )
286
283
 
287
284
  if valid_meta:
@@ -292,10 +289,10 @@ class ChromaDocumentStore:
292
289
 
293
290
  if hasattr(doc, "sparse_embedding") and doc.sparse_embedding is not None:
294
291
  logger.warning(
295
- "Document %s has the `sparse_embedding` field set,"
296
- "but storing sparse embeddings in Chroma is not currently supported."
292
+ "Document {doc_id} has the `sparse_embedding` field set, "
293
+ "but storing sparse embeddings in Chroma is not currently supported. "
297
294
  "The `sparse_embedding` field will be ignored.",
298
- doc.id,
295
+ doc_id=doc.id,
299
296
  )
300
297
 
301
298
  self._collection.add(**data)
@@ -237,15 +237,15 @@ class TestDocumentStore(CountDocumentsTest, DeleteDocumentsTest, FilterDocuments
237
237
  document_store.write_documents([Document(content=None)])
238
238
  assert document_store.filter_documents() == []
239
239
 
240
- def test_dataframe_and_blob_are_not_stored(self, document_store: ChromaDocumentStore):
240
+ def test_blob_not_stored(self, document_store: ChromaDocumentStore):
241
241
  bs = ByteStream(data=b"test")
242
242
  doc_mixed = Document(content="test", blob=bs)
243
- doc_mixed.dataframe = "non null content" # just a placeholder
244
243
 
245
244
  document_store.write_documents([doc_mixed])
246
245
 
247
- expected_doc = Document(id=doc_mixed.id, content="test")
248
- assert document_store.filter_documents() == [expected_doc]
246
+ retrieved_doc = document_store.filter_documents()[0]
247
+ assert retrieved_doc.content == "test"
248
+ assert retrieved_doc.blob is None
249
249
 
250
250
  @pytest.mark.integration
251
251
  def test_to_dict(self, request):
File without changes