chroma-haystack 5.0.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.
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/CHANGELOG.md +11 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/PKG-INFO +1 -1
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/filters.py +2 -3
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/tests/test_document_store.py +33 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/tests/test_filters.py +41 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/.gitignore +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/LICENSE.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/README.md +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_01.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_02.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_03.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_04.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_05.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_06.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_07.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_08.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_09.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_10.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_11.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_12.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_20.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_21.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_22.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_23.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_24.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_25.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_26.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_27.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_28.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_29.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_30.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_31.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_32.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_40.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_41.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_42.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_43.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_44.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_45.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_46.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_50.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_51.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_52.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/data/usr_90.txt +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/example/example.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/pydoc/config_docusaurus.yml +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/pyproject.toml +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/components/retrievers/chroma/__init__.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/components/retrievers/chroma/retriever.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/components/retrievers/py.typed +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/__init__.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/document_store.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/errors.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/chroma/utils.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/py.typed +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/tests/__init__.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/tests/conftest.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/tests/test_document_store_async.py +0 -0
- {chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/tests/test_retriever.py +0 -0
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
|
|
3
14
|
## [integrations/chroma-v4.5.0] - 2026-09-01
|
|
4
15
|
|
|
5
16
|
### 🐛 Bug Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: chroma-haystack
|
|
3
|
-
Version: 5.
|
|
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
|
|
@@ -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
|
-
#
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chroma_haystack-5.0.0 → chroma_haystack-5.1.0}/src/haystack_integrations/document_stores/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|