Skip to content

Commit

Permalink
Feature/bump chromadb dep to 0.5.0 (deepset-ai#700)
Browse files Browse the repository at this point in the history
* [DEP]: Bump chromadb version

Remove specific version pin

* Fix: chromadb tests failing due to sort order variance

Fix: linting error

* Add OllamaEmbeddingFunction to function registry

Linting
  • Loading branch information
jongirard committed May 2, 2024
1 parent 4852115 commit ca87b0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion integrations/chroma/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
]
dependencies = [
"haystack-ai",
"chromadb<0.4.20", # FIXME: investigate why filtering tests broke on 0.4.20
"chromadb",
"typing_extensions>=4.8.0"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
GoogleVertexEmbeddingFunction,
HuggingFaceEmbeddingFunction,
InstructorEmbeddingFunction,
OllamaEmbeddingFunction,
ONNXMiniLM_L6_V2,
OpenAIEmbeddingFunction,
SentenceTransformerEmbeddingFunction,
Expand All @@ -25,6 +26,7 @@
"GoogleVertexEmbeddingFunction": GoogleVertexEmbeddingFunction,
"HuggingFaceEmbeddingFunction": HuggingFaceEmbeddingFunction,
"InstructorEmbeddingFunction": InstructorEmbeddingFunction,
"OllamaEmbeddingFunction": OllamaEmbeddingFunction,
"ONNXMiniLM_L6_V2": ONNXMiniLM_L6_V2,
"OpenAIEmbeddingFunction": OpenAIEmbeddingFunction,
"Text2VecEmbeddingFunction": Text2VecEmbeddingFunction,
Expand Down
4 changes: 4 additions & 0 deletions integrations/chroma/tests/test_document_store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2023-present John Doe <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
import operator
import uuid
from typing import List
from unittest import mock
Expand Down Expand Up @@ -56,6 +57,9 @@ def assert_documents_are_equal(self, received: List[Document], expected: List[Do
This can happen for example when the Document Store sets a score to returned Documents.
Since we can't know what the score will be, we can't compare the Documents reliably.
"""
received.sort(key=operator.attrgetter("id"))
expected.sort(key=operator.attrgetter("id"))

for doc_received, doc_expected in zip(received, expected):
assert doc_received.content == doc_expected.content
assert doc_received.meta == doc_expected.meta
Expand Down

0 comments on commit ca87b0e

Please sign in to comment.