chroma-haystack 4.5.0__tar.gz → 5.1.0__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 (59) hide show
  1. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/CHANGELOG.md +57 -11
  2. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/PKG-INFO +2 -3
  3. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/pyproject.toml +1 -2
  4. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/filters.py +2 -3
  5. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/tests/test_document_store.py +33 -0
  6. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/tests/test_filters.py +41 -0
  7. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/.gitignore +0 -0
  8. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/LICENSE.txt +0 -0
  9. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/README.md +0 -0
  10. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_01.txt +0 -0
  11. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_02.txt +0 -0
  12. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_03.txt +0 -0
  13. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_04.txt +0 -0
  14. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_05.txt +0 -0
  15. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_06.txt +0 -0
  16. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_07.txt +0 -0
  17. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_08.txt +0 -0
  18. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_09.txt +0 -0
  19. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_10.txt +0 -0
  20. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_11.txt +0 -0
  21. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_12.txt +0 -0
  22. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_20.txt +0 -0
  23. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_21.txt +0 -0
  24. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_22.txt +0 -0
  25. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_23.txt +0 -0
  26. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_24.txt +0 -0
  27. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_25.txt +0 -0
  28. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_26.txt +0 -0
  29. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_27.txt +0 -0
  30. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_28.txt +0 -0
  31. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_29.txt +0 -0
  32. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_30.txt +0 -0
  33. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_31.txt +0 -0
  34. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_32.txt +0 -0
  35. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_40.txt +0 -0
  36. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_41.txt +0 -0
  37. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_42.txt +0 -0
  38. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_43.txt +0 -0
  39. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_44.txt +0 -0
  40. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_45.txt +0 -0
  41. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_46.txt +0 -0
  42. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_50.txt +0 -0
  43. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_51.txt +0 -0
  44. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_52.txt +0 -0
  45. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/data/usr_90.txt +0 -0
  46. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/example/example.py +0 -0
  47. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/pydoc/config_docusaurus.yml +0 -0
  48. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/components/retrievers/chroma/__init__.py +0 -0
  49. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/components/retrievers/chroma/retriever.py +0 -0
  50. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/components/retrievers/py.typed +0 -0
  51. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/__init__.py +0 -0
  52. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/document_store.py +0 -0
  53. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/errors.py +0 -0
  54. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/utils.py +0 -0
  55. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/py.typed +0 -0
  56. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/tests/__init__.py +0 -0
  57. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/tests/conftest.py +0 -0
  58. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/tests/test_document_store_async.py +0 -0
  59. {chroma_haystack-4.5.0 → chroma_haystack-5.1.0}/tests/test_retriever.py +0 -0
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/chroma-v5.0.0] - 2026-10-16
4
+
5
+ ### ⚙️ CI
6
+
7
+ - Improve changelog generation; fix existing changelogs (#3883)
8
+
9
+ ### 🧹 Chores
10
+
11
+ - [**breaking**] Drop Python 3.10 support (#4105)
12
+
13
+
14
+ ## [integrations/chroma-v4.5.0] - 2026-09-01
15
+
16
+ ### 🐛 Bug Fixes
17
+
18
+ - Fix new issues raised by ruff 0.16.0 (#3670)
19
+ - `ChromDocumentStore` get_metadata_field_unique_values setting list of values to return to `Any` (#3707)
20
+ - Chroma adding optional parameter `filters` to `get_metadata_field_unique_values()` (#3742)
21
+ - Standardize license files (#3771)
22
+ - `ChromaDocumentStore` removing duplicated tests already covered by haystack Mixin tests + fixing dedup values (#3777)
23
+
24
+ ### 🧹 Chores
25
+
26
+ - Re-standardize READMEs (#3768)
27
+
28
+
3
29
  ## [integrations/chroma-v4.4.0] - 2026-07-24
4
30
 
5
31
  ### 🚀 Features
@@ -109,10 +135,6 @@
109
135
  - Adding `delete_by_filter()` and `update_by_filter()` to `ChromaDocumentStore` (#2649)
110
136
 
111
137
 
112
- ### ⚙️ CI
113
-
114
- - Change pytest command (#2475)
115
-
116
138
  ### 🧹 Chores
117
139
 
118
140
  - Remove Readme API CI workflow and configs (#2573)
@@ -121,6 +143,13 @@
121
143
 
122
144
  - Adopt PEP 585 type hinting (part 1) (#2509)
123
145
 
146
+ ## [integrations/chroma-v3.4.1] - 2025-11-11
147
+
148
+ ### ⚙️ CI
149
+
150
+ - Change pytest command (#2475)
151
+
152
+
124
153
  ## [integrations/chroma-v3.4.0] - 2025-10-27
125
154
 
126
155
  ### 🚀 Features
@@ -160,6 +189,8 @@
160
189
 
161
190
  - Align core-integrations Hatch scripts (#1898)
162
191
 
192
+ ## [integrations/chroma-v3.1.0] - 2025-04-14
193
+
163
194
 
164
195
  ## [integrations/chroma-v2.0.3] - 2025-04-04
165
196
 
@@ -279,15 +310,29 @@
279
310
 
280
311
  ## [integrations/chroma-v0.20.1] - 2024-07-15
281
312
 
313
+ ### 🐛 Bug Fixes
314
+
315
+ - `Chroma` - Fallback to default filter policy when deserializing retrievers without the init parameter (#897)
316
+
317
+ ## [integrations/chroma-v0.20.0] - 2024-07-15
318
+
282
319
  ### 🚀 Features
283
320
 
284
- - Added distance_function property to ChromadocumentStore (#817)
285
321
  - Add filter_policy to chroma integration (#826)
286
322
 
287
323
  ### 🐛 Bug Fixes
288
324
 
289
325
  - Allow search in ChromaDocumentStore without metadata (#863)
290
- - `Chroma` - Fallback to default filter policy when deserializing retrievers without the init parameter (#897)
326
+
327
+ ### 🌀 Miscellaneous
328
+
329
+ - Chore: Minor retriever pydoc fix (#884)
330
+
331
+ ## [integrations/chroma-v0.19.0] - 2024-07-01
332
+
333
+ ### 🚀 Features
334
+
335
+ - Added distance_function property to ChromadocumentStore (#817)
291
336
 
292
337
  ### ⚙️ CI
293
338
 
@@ -300,7 +345,6 @@
300
345
  ### 🌀 Miscellaneous
301
346
 
302
347
  - Ci: install `pytest-rerunfailures` where needed; add retry config to `test-cov` script (#845)
303
- - Chore: Minor retriever pydoc fix (#884)
304
348
 
305
349
  ## [integrations/chroma-v0.18.0] - 2024-05-31
306
350
 
@@ -374,15 +418,17 @@
374
418
 
375
419
  ## [integrations/chroma-v0.11.0] - 2024-01-18
376
420
 
377
- ### 🐛 Bug Fixes
378
-
379
- - Chroma DocumentStore creation for pre-existing collection name (#157)
380
-
381
421
  ### 🌀 Miscellaneous
382
422
 
383
423
  - Mount chroma integration under `haystack_integrations.*` (#193)
384
424
  - Remove ChromaSingleQueryRetriever (#240)
385
425
 
426
+ ## [integrations/chroma-v0.10.0] - 2024-01-17
427
+
428
+ ### 🐛 Bug Fixes
429
+
430
+ - Chroma DocumentStore creation for pre-existing collection name (#157)
431
+
386
432
  ## [integrations/chroma-v0.9.0] - 2023-12-20
387
433
 
388
434
  ### 🐛 Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: chroma-haystack
3
- Version: 4.5.0
3
+ Version: 5.1.0
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
@@ -10,14 +10,13 @@ License-File: LICENSE.txt
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Programming Language :: Python
13
- Classifier: Programming Language :: Python :: 3.10
14
13
  Classifier: Programming Language :: Python :: 3.11
15
14
  Classifier: Programming Language :: Python :: 3.12
16
15
  Classifier: Programming Language :: Python :: 3.13
17
16
  Classifier: Programming Language :: Python :: 3.14
18
17
  Classifier: Programming Language :: Python :: Implementation :: CPython
19
18
  Classifier: Programming Language :: Python :: Implementation :: PyPy
20
- Requires-Python: >=3.10
19
+ Requires-Python: >=3.11
21
20
  Requires-Dist: chromadb>=1.5.4
22
21
  Requires-Dist: haystack-ai>=2.28.0
23
22
  Description-Content-Type: text/markdown
@@ -7,7 +7,7 @@ name = "chroma-haystack"
7
7
  dynamic = ["version"]
8
8
  description = ''
9
9
  readme = "README.md"
10
- requires-python = ">=3.10"
10
+ requires-python = ">=3.11"
11
11
  license = "Apache-2.0"
12
12
  keywords = []
13
13
  authors = [{ name = "deepset GmbH", email = "info@deepset.ai" }]
@@ -15,7 +15,6 @@ classifiers = [
15
15
  "License :: OSI Approved :: Apache Software License",
16
16
  "Development Status :: 4 - Beta",
17
17
  "Programming Language :: Python",
18
- "Programming Language :: Python :: 3.10",
19
18
  "Programming Language :: Python :: 3.11",
20
19
  "Programming Language :: Python :: 3.12",
21
20
  "Programming Language :: Python :: 3.13",
@@ -49,7 +49,6 @@ def _convert_filters(filters: dict[str, Any]) -> ChromaFilter:
49
49
  Separates filters into ids, metadata filters, and content filters to be passed to chroma as ids, where,
50
50
  and where_document clauses respectively.
51
51
  """
52
-
53
52
  ids = []
54
53
  where: dict[str, Any] = defaultdict(list)
55
54
  where_document: dict[str, Any] = defaultdict(list)
@@ -66,8 +65,8 @@ def _convert_filters(filters: dict[str, Any]) -> ChromaFilter:
66
65
  where_document.update(_create_where_document_filter(field, value))
67
66
  if where_document:
68
67
  continue
69
- # if field is "id", it'll be passed to Chroma's ids filter
70
- elif field == "id":
68
+ # Only the unprefixed id field targets Chroma document IDs.
69
+ elif field == "id" and filters.get("field") == "id":
71
70
  if "$eq" not in value or not value["$eq"]:
72
71
  msg = f"id filter only supports '==' operator, got {value}"
73
72
  raise ChromaDocumentStoreFilterError(msg)
@@ -314,6 +314,39 @@ class TestDocumentStore(
314
314
  get_func.return_value = embedding_function
315
315
  return ChromaDocumentStore(embedding_function="test_function", collection_name=str(uuid.uuid1()))
316
316
 
317
+ @pytest.mark.parametrize(
318
+ ("filters", "expected_ids"),
319
+ [
320
+ ({"field": "meta.id", "operator": "==", "value": "target"}, ["document-a"]),
321
+ ({"field": "meta.id", "operator": "!=", "value": "target"}, ["target"]),
322
+ ({"field": "id", "operator": "==", "value": "target"}, ["target"]),
323
+ ],
324
+ ids=["equal", "not_equal", "document_id"],
325
+ )
326
+ def test_metadata_id_filters_preserve_document_identity(
327
+ self, document_store: ChromaDocumentStore, filters, expected_ids
328
+ ):
329
+ document_store.write_documents(
330
+ [
331
+ Document(id="document-a", content="matching metadata", meta={"id": "target"}),
332
+ Document(id="target", content="nonmatching metadata", meta={"id": "other"}),
333
+ ]
334
+ )
335
+
336
+ assert [document.id for document in document_store.filter_documents(filters=filters)] == expected_ids
337
+
338
+ def test_delete_by_filter_metadata_id(self, document_store: ChromaDocumentStore):
339
+ document_store.write_documents(
340
+ [
341
+ Document(id="document-a", content="matching metadata", meta={"id": "target"}),
342
+ Document(id="target", content="nonmatching metadata", meta={"id": "other"}),
343
+ ]
344
+ )
345
+
346
+ filters = {"field": "meta.id", "operator": "==", "value": "target"}
347
+ assert document_store.delete_by_filter(filters=filters) == 1
348
+ assert [document.id for document in document_store.filter_documents()] == ["target"]
349
+
317
350
  def assert_documents_are_equal(self, received: list[Document], expected: list[Document]):
318
351
  """
319
352
  Assert that two lists of Documents are equal.
@@ -51,3 +51,44 @@ def test_parse_logical_condition_errors(condition, match):
51
51
  def test_parse_comparison_condition_errors(condition, match):
52
52
  with pytest.raises(ChromaDocumentStoreFilterError, match=match):
53
53
  _parse_comparison_condition(condition)
54
+
55
+
56
+ @pytest.mark.parametrize(
57
+ ("operator", "value", "chroma_operator"),
58
+ [
59
+ ("==", "target", "$eq"),
60
+ ("!=", "target", "$ne"),
61
+ ("in", ["target"], "$in"),
62
+ ("not in", ["target"], "$nin"),
63
+ ("==", "", "$eq"),
64
+ ],
65
+ )
66
+ def test_metadata_id_filters_keep_metadata_comparisons(operator, value, chroma_operator):
67
+ result = _convert_filters({"field": "meta.id", "operator": operator, "value": value})
68
+
69
+ assert result.ids == []
70
+ assert result.where == {"id": {chroma_operator: value}}
71
+ assert result.where_document is None
72
+
73
+
74
+ def test_document_id_filter_uses_ids():
75
+ result = _convert_filters({"field": "id", "operator": "==", "value": "target"})
76
+
77
+ assert result.ids == ["target"]
78
+ assert result.where is None
79
+ assert result.where_document is None
80
+
81
+
82
+ @pytest.mark.parametrize(
83
+ ("condition", "category"),
84
+ [
85
+ ({"field": "meta.id", "operator": "in", "value": "target"}, "metadata filter"),
86
+ ({"field": "content", "operator": "contains", "value": 123}, "document content filter"),
87
+ ],
88
+ ids=["invalid_metadata_membership", "invalid_content_value"],
89
+ )
90
+ def test_invalid_filters_wrap_chroma_validation_errors(condition, category):
91
+ with pytest.raises(ChromaDocumentStoreFilterError, match=f"Invalid '{category}'") as exception_info:
92
+ _convert_filters(condition)
93
+
94
+ assert isinstance(exception_info.value.__cause__, ValueError)