chroma-haystack 2.0.1__tar.gz → 2.0.3__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 (56) hide show
  1. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/CHANGELOG.md +153 -0
  2. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/PKG-INFO +5 -3
  3. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/pyproject.toml +3 -7
  4. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/src/haystack_integrations/components/retrievers/chroma/__init__.py +4 -0
  5. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/src/haystack_integrations/components/retrievers/chroma/retriever.py +2 -1
  6. chroma_haystack-2.0.3/src/haystack_integrations/document_stores/chroma/__init__.py +7 -0
  7. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/src/haystack_integrations/document_stores/chroma/document_store.py +20 -21
  8. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/src/haystack_integrations/document_stores/chroma/errors.py +2 -1
  9. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/src/haystack_integrations/document_stores/chroma/filters.py +4 -0
  10. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/src/haystack_integrations/document_stores/chroma/utils.py +2 -1
  11. chroma_haystack-2.0.3/tests/__init__.py +3 -0
  12. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/tests/test_document_store.py +7 -7
  13. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/tests/test_retriever.py +1 -0
  14. chroma_haystack-2.0.1/src/haystack_integrations/document_stores/chroma/__init__.py +0 -3
  15. chroma_haystack-2.0.1/tests/__init__.py +0 -3
  16. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/.gitignore +0 -0
  17. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/LICENSE +0 -0
  18. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/README.md +0 -0
  19. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_01.txt +0 -0
  20. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_02.txt +0 -0
  21. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_03.txt +0 -0
  22. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_04.txt +0 -0
  23. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_05.txt +0 -0
  24. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_06.txt +0 -0
  25. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_07.txt +0 -0
  26. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_08.txt +0 -0
  27. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_09.txt +0 -0
  28. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_10.txt +0 -0
  29. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_11.txt +0 -0
  30. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_12.txt +0 -0
  31. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_20.txt +0 -0
  32. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_21.txt +0 -0
  33. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_22.txt +0 -0
  34. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_23.txt +0 -0
  35. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_24.txt +0 -0
  36. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_25.txt +0 -0
  37. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_26.txt +0 -0
  38. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_27.txt +0 -0
  39. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_28.txt +0 -0
  40. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_29.txt +0 -0
  41. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_30.txt +0 -0
  42. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_31.txt +0 -0
  43. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_32.txt +0 -0
  44. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_40.txt +0 -0
  45. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_41.txt +0 -0
  46. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_42.txt +0 -0
  47. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_43.txt +0 -0
  48. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_44.txt +0 -0
  49. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_45.txt +0 -0
  50. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_46.txt +0 -0
  51. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_50.txt +0 -0
  52. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_51.txt +0 -0
  53. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_52.txt +0 -0
  54. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/data/usr_90.txt +0 -0
  55. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/example/example.py +0 -0
  56. {chroma_haystack-2.0.1 → chroma_haystack-2.0.3}/pydoc/config.yml +0 -0
@@ -1,222 +1,375 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/chroma-v2.0.2] - 2025-04-04
4
+
5
+
6
+
7
+
8
+ ### ⚙️ CI
9
+
10
+
11
+ - Review testing workflows (#1541)
12
+
13
+
14
+ ### 🌀 Miscellaneous
15
+
16
+
17
+ - Fix: Pin chroma (#1608)
18
+
19
+ ## [integrations/chroma-v3.0.0] - 2025-03-11
20
+
21
+
22
+
23
+
24
+ ### 🧹 Chores
25
+
26
+
27
+ - Use Haystack logging across integrations (#1484)
28
+
29
+
30
+ ### 🌀 Miscellaneous
31
+
32
+
33
+ - Fix: Chroma - relax dataframe/blob test (#1404)
34
+
35
+ - Pin haystack and remove dataframe checks (#1501)
36
+
37
+ ## [integrations/chroma-v2.0.1] - 2025-02-14
38
+
39
+
40
+ ### 🌀 Miscellaneous
41
+
42
+
43
+
44
+ - Better handle discarded fields (#1373)
45
+
3
46
  ## [integrations/chroma-v1.0.1] - 2025-02-14
4
47
 
48
+
5
49
  ### 🧹 Chores
6
50
 
51
+
7
52
  - Inherit from `FilterDocumentsTestWithDataframe` in Document Stores (#1290)
8
53
 
54
+
9
55
  ### 🌀 Miscellaneous
10
56
 
57
+
58
+
11
59
  - Fix: Chroma - make `filter_documents` method return embeddings (#1361)
12
60
 
13
61
  ## [integrations/chroma-v2.0.0] - 2025-01-02
14
62
 
63
+
15
64
  ### 🧹 Chores
16
65
 
66
+
17
67
  - Fix linting/isort (#1215)
68
+
18
69
  - Chroma - pin `tokenizers` (#1223)
19
70
 
71
+
20
72
  ### 🌀 Miscellaneous
21
73
 
74
+
75
+
22
76
  - Unpin tokenizers (#1233)
77
+
23
78
  - Fix: updates for Chroma 0.6.0 (#1270)
24
79
 
25
80
  ## [integrations/chroma-v1.0.0] - 2024-11-06
26
81
 
82
+
27
83
  ### 🐛 Bug Fixes
28
84
 
85
+
29
86
  - Fixing Chroma tests due `chromadb` update behaviour change (#1148)
87
+
30
88
  - Adapt our implementation to breaking changes in Chroma 0.5.17 (#1165)
31
89
 
90
+
32
91
  ### ⚙️ CI
33
92
 
93
+
34
94
  - Adopt uv as installer (#1142)
35
95
 
36
96
 
97
+
37
98
  ## [integrations/chroma-v0.22.1] - 2024-09-30
38
99
 
100
+
39
101
  ### 🌀 Miscellaneous
40
102
 
103
+
104
+
41
105
  - Empty filters should behave as no filters (#1117)
42
106
 
43
107
  ## [integrations/chroma-v0.22.0] - 2024-09-30
44
108
 
109
+
45
110
  ### 🚀 Features
46
111
 
112
+
47
113
  - Chroma - allow remote HTTP connection (#1094)
114
+
48
115
  - Chroma - defer the DB connection (#1107)
49
116
 
117
+
50
118
  ### 🐛 Bug Fixes
51
119
 
120
+
52
121
  - Refactor: fix chroma linting; do not use numpy (#1063)
122
+
53
123
  - Filters in chroma integration (#1072)
54
124
 
125
+
55
126
  ### 🧪 Testing
56
127
 
128
+
57
129
  - Do not retry tests in `hatch run test` command (#954)
58
130
 
131
+
59
132
  ### 🧹 Chores
60
133
 
134
+
61
135
  - Chroma - ruff update, don't ruff tests (#983)
136
+
62
137
  - Update ruff linting scripts and settings (#1105)
63
138
 
139
+
64
140
  ### 🌀 Miscellaneous
65
141
 
142
+
143
+
66
144
  - Chore: ChromaDocumentStore lint fix (#1065)
67
145
 
68
146
  ## [integrations/chroma-v0.21.1] - 2024-07-17
69
147
 
148
+
70
149
  ### 🐛 Bug Fixes
71
150
 
151
+
72
152
  - `ChromaDocumentStore` - discard `meta` items when the type of their value is not supported in Chroma (#907)
73
153
 
74
154
 
155
+
75
156
  ## [integrations/chroma-v0.21.0] - 2024-07-16
76
157
 
158
+
77
159
  ### 🚀 Features
78
160
 
161
+
79
162
  - Add metadata parameter to ChromaDocumentStore. (#906)
80
163
 
81
164
 
165
+
82
166
  ## [integrations/chroma-v0.20.1] - 2024-07-15
83
167
 
168
+
84
169
  ### 🚀 Features
85
170
 
171
+
86
172
  - Added distance_function property to ChromadocumentStore (#817)
173
+
87
174
  - Add filter_policy to chroma integration (#826)
88
175
 
176
+
89
177
  ### 🐛 Bug Fixes
90
178
 
179
+
91
180
  - Allow search in ChromaDocumentStore without metadata (#863)
181
+
92
182
  - `Chroma` - Fallback to default filter policy when deserializing retrievers without the init parameter (#897)
93
183
 
184
+
94
185
  ### ⚙️ CI
95
186
 
187
+
96
188
  - Retry tests to reduce flakyness (#836)
97
189
 
190
+
98
191
  ### 🧹 Chores
99
192
 
193
+
100
194
  - Update ruff invocation to include check parameter (#853)
101
195
 
196
+
102
197
  ### 🌀 Miscellaneous
103
198
 
199
+
200
+
104
201
  - Ci: install `pytest-rerunfailures` where needed; add retry config to `test-cov` script (#845)
202
+
105
203
  - Chore: Minor retriever pydoc fix (#884)
106
204
 
107
205
  ## [integrations/chroma-v0.18.0] - 2024-05-31
108
206
 
207
+
109
208
  ### 🌀 Miscellaneous
110
209
 
210
+
111
211
  - Chore: pin chromadb>=0.5.0 (#777)
112
212
 
113
213
  ## [integrations/chroma-v0.17.0] - 2024-05-10
114
214
 
215
+
115
216
  ### 🌀 Miscellaneous
116
217
 
218
+
117
219
  - Chore: change the pydoc renderer class (#718)
220
+
118
221
  - Implement filters for chromaQueryTextRetriever via existing haystack filters logic (#705)
119
222
 
120
223
  ## [integrations/chroma-v0.16.0] - 2024-05-02
121
224
 
225
+
122
226
  ### 📚 Documentation
123
227
 
228
+
124
229
  - Small consistency improvements (#536)
230
+
125
231
  - Disable-class-def (#556)
126
232
 
233
+
127
234
  ### 🌀 Miscellaneous
128
235
 
236
+
129
237
  - Make tests show coverage (#566)
238
+
130
239
  - Refactor tests (#574)
240
+
131
241
  - Remove references to Python 3.7 (#601)
242
+
132
243
  - Make Document Stores initially skip `SparseEmbedding` (#606)
244
+
133
245
  - Pin databind-core (#619)
246
+
134
247
  - Chore: add license classifiers (#680)
248
+
135
249
  - Feature/bump chromadb dep to 0.5.0 (#700)
136
250
 
137
251
  ## [integrations/chroma-v0.15.0] - 2024-03-01
138
252
 
253
+
139
254
  ### 🌀 Miscellaneous
140
255
 
256
+
141
257
  - Release chroma on python 3.8 (#512)
142
258
 
143
259
  ## [integrations/chroma-v0.14.0] - 2024-02-29
144
260
 
261
+
145
262
  ### 🐛 Bug Fixes
146
263
 
264
+
147
265
  - Fix order of API docs (#447)
266
+
148
267
  - Serialize the path to the local db (#506)
149
268
 
269
+
150
270
  ### 📚 Documentation
151
271
 
272
+
152
273
  - Update category slug (#442)
274
+
153
275
  - Review chroma integration (#501)
154
276
 
277
+
155
278
  ### 🌀 Miscellaneous
156
279
 
280
+
157
281
  - Small improvements (#443)
282
+
158
283
  - Fix: make write_documents compatible with the DocumentStore protocol (#505)
159
284
 
160
285
  ## [integrations/chroma-v0.13.0] - 2024-02-13
161
286
 
287
+
162
288
  ### 🌀 Miscellaneous
163
289
 
290
+
164
291
  - Chroma: rename retriever (#407)
165
292
 
166
293
  ## [integrations/chroma-v0.12.0] - 2024-02-06
167
294
 
295
+
168
296
  ### 🚀 Features
169
297
 
298
+
170
299
  - Generate API docs (#262)
171
300
 
301
+
172
302
  ### 🌀 Miscellaneous
173
303
 
304
+
174
305
  - Add typing_extensions pin to Chroma integration (#295)
306
+
175
307
  - Allows filters and persistent document stores for Chroma (#342)
176
308
 
177
309
  ## [integrations/chroma-v0.11.0] - 2024-01-18
178
310
 
311
+
179
312
  ### 🐛 Bug Fixes
180
313
 
314
+
181
315
  - Chroma DocumentStore creation for pre-existing collection name (#157)
182
316
 
317
+
183
318
  ### 🌀 Miscellaneous
184
319
 
320
+
185
321
  - Mount chroma integration under `haystack_integrations.*` (#193)
322
+
186
323
  - Remove ChromaSingleQueryRetriever (#240)
187
324
 
188
325
  ## [integrations/chroma-v0.9.0] - 2023-12-20
189
326
 
327
+
190
328
  ### 🐛 Bug Fixes
191
329
 
330
+
192
331
  - Fix project URLs (#96)
193
332
 
333
+
194
334
  ### 🚜 Refactor
195
335
 
336
+
196
337
  - Use `hatch_vcs` to manage integrations versioning (#103)
197
338
 
339
+
198
340
  ### 🌀 Miscellaneous
199
341
 
342
+
200
343
  - Chore: pin chroma version (#104)
344
+
201
345
  - Fix: update to the latest Document format (#127)
202
346
 
203
347
  ## [integrations/chroma-v0.8.1] - 2023-12-05
204
348
 
349
+
205
350
  ### 🐛 Bug Fixes
206
351
 
352
+
207
353
  - Document Stores: fix protocol import (#77)
208
354
 
209
355
  ## [integrations/chroma-v0.8.0] - 2023-12-04
210
356
 
357
+
211
358
  ### 🐛 Bug Fixes
212
359
 
360
+
213
361
  - Fix license headers
214
362
 
363
+
215
364
  ### 🌀 Miscellaneous
216
365
 
366
+
217
367
  - Reorganize repository (#62)
368
+
218
369
  - Update import paths (#64)
370
+
219
371
  - Patch chroma filters tests (#67)
372
+
220
373
  - Remove Document Store decorator (#76)
221
374
 
222
375
  <!-- generated by git-cliff -->
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chroma-haystack
3
- Version: 2.0.1
3
+ Version: 2.0.3
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.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>=1.0.0"]
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,3 +1,7 @@
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
1
5
  from .retriever import ChromaEmbeddingRetriever, ChromaQueryTextRetriever
2
6
 
3
7
  __all__ = ["ChromaEmbeddingRetriever", "ChromaQueryTextRetriever"]
@@ -1,6 +1,7 @@
1
- # SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+
4
5
  from typing import Any, Dict, List, Optional, Union
5
6
 
6
7
  from haystack import Document, component, default_from_dict, default_to_dict
@@ -0,0 +1,7 @@
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ from .document_store import ChromaDocumentStore
6
+
7
+ __all__ = ["ChromaDocumentStore"]
@@ -1,12 +1,12 @@
1
- # SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
- import logging
4
+
5
5
  from typing import Any, Dict, List, Literal, Optional
6
6
 
7
7
  import chromadb
8
8
  from chromadb.api.types import GetResult, QueryResult
9
- from haystack import default_from_dict, default_to_dict
9
+ from haystack import default_from_dict, default_to_dict, logging
10
10
  from haystack.dataclasses import Document
11
11
  from haystack.document_stores.types import DuplicatePolicy
12
12
  from numpy import ndarray
@@ -117,7 +117,8 @@ class ChromaDocumentStore:
117
117
  if "hnsw:space" not in self._metadata:
118
118
  self._metadata["hnsw:space"] = self._distance_function
119
119
 
120
- if self._collection_name in client.list_collections():
120
+ existing_collection_names = [c.name for c in client.list_collections()]
121
+ if self._collection_name in existing_collection_names:
121
122
  self._collection = client.get_collection(self._collection_name, embedding_function=self._embedding_func)
122
123
 
123
124
  if self._metadata != self._collection.metadata:
@@ -250,18 +251,16 @@ class ChromaDocumentStore:
250
251
  if doc.content is None:
251
252
  logger.warning(
252
253
  "ChromaDocumentStore cannot store documents with `content=None`. "
253
- "Document with id %s will be skipped.",
254
- doc.id,
254
+ "Document with id {doc_id} will be skipped.",
255
+ doc_id=doc.id,
255
256
  )
256
257
  continue
257
- elif (hasattr(doc, "dataframe") and doc.dataframe is not None) or (
258
- hasattr(doc, "blob") and doc.blob is not None
259
- ):
258
+ elif hasattr(doc, "blob") and doc.blob is not None:
260
259
  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,
260
+ "Document with id {doc_id} contains the `blob` field. "
261
+ "ChromaDocumentStore cannot store `blob` fields. "
262
+ "This field will be ignored.",
263
+ doc_id=doc.id,
265
264
  )
266
265
  data = {"ids": [doc.id], "documents": [doc.content]}
267
266
 
@@ -277,11 +276,11 @@ class ChromaDocumentStore:
277
276
 
278
277
  if discarded_keys:
279
278
  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]),
279
+ "Document {doc_id} contains `meta` values of unsupported types for the keys: {keys}. "
280
+ "These items will be discarded. Supported types are: {types}.",
281
+ doc_id=doc.id,
282
+ keys=", ".join(discarded_keys),
283
+ types=", ".join([t.__name__ for t in SUPPORTED_TYPES_FOR_METADATA_VALUES]),
285
284
  )
286
285
 
287
286
  if valid_meta:
@@ -292,10 +291,10 @@ class ChromaDocumentStore:
292
291
 
293
292
  if hasattr(doc, "sparse_embedding") and doc.sparse_embedding is not None:
294
293
  logger.warning(
295
- "Document %s has the `sparse_embedding` field set,"
296
- "but storing sparse embeddings in Chroma is not currently supported."
294
+ "Document {doc_id} has the `sparse_embedding` field set, "
295
+ "but storing sparse embeddings in Chroma is not currently supported. "
297
296
  "The `sparse_embedding` field will be ignored.",
298
- doc.id,
297
+ doc_id=doc.id,
299
298
  )
300
299
 
301
300
  self._collection.add(**data)
@@ -1,6 +1,7 @@
1
- # SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+
4
5
  from haystack.document_stores.errors import DocumentStoreError
5
6
  from haystack.errors import FilterError
6
7
 
@@ -1,3 +1,7 @@
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
1
5
  from collections import defaultdict
2
6
  from dataclasses import dataclass
3
7
  from typing import Any, Dict, List, Optional
@@ -1,6 +1,7 @@
1
- # SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+
4
5
  from chromadb.api.types import EmbeddingFunction
5
6
  from chromadb.utils.embedding_functions import (
6
7
  CohereEmbeddingFunction,
@@ -0,0 +1,3 @@
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
@@ -1,6 +1,7 @@
1
- # SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
1
+ # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+
4
5
  import logging
5
6
  import operator
6
7
  import sys
@@ -237,15 +238,15 @@ class TestDocumentStore(CountDocumentsTest, DeleteDocumentsTest, FilterDocuments
237
238
  document_store.write_documents([Document(content=None)])
238
239
  assert document_store.filter_documents() == []
239
240
 
240
- def test_dataframe_and_blob_are_not_stored(self, document_store: ChromaDocumentStore):
241
+ def test_blob_not_stored(self, document_store: ChromaDocumentStore):
241
242
  bs = ByteStream(data=b"test")
242
243
  doc_mixed = Document(content="test", blob=bs)
243
- doc_mixed.dataframe = "non null content" # just a placeholder
244
244
 
245
245
  document_store.write_documents([doc_mixed])
246
246
 
247
- expected_doc = Document(id=doc_mixed.id, content="test")
248
- assert document_store.filter_documents() == [expected_doc]
247
+ retrieved_doc = document_store.filter_documents()[0]
248
+ assert retrieved_doc.content == "test"
249
+ assert retrieved_doc.blob is None
249
250
 
250
251
  @pytest.mark.integration
251
252
  def test_to_dict(self, request):
@@ -347,8 +348,7 @@ class TestDocumentStore(CountDocumentsTest, DeleteDocumentsTest, FilterDocuments
347
348
  "hnsw:M": 103,
348
349
  },
349
350
  )
350
-
351
- new_store._ensure_initialized()
351
+ new_store._ensure_initialized()
352
352
 
353
353
  assert (
354
354
  "Collection already exists. The `distance_function` and `metadata` parameters will be ignored."
@@ -1,6 +1,7 @@
1
1
  # SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+
4
5
  import pytest
5
6
  from haystack.document_stores.types import FilterPolicy
6
7
 
@@ -1,3 +0,0 @@
1
- from .document_store import ChromaDocumentStore
2
-
3
- __all__ = ["ChromaDocumentStore"]
@@ -1,3 +0,0 @@
1
- # SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
2
- #
3
- # SPDX-License-Identifier: Apache-2.0
File without changes