diff --git a/integrations/weaviate/src/haystack_integrations/document_stores/weaviate/document_store.py b/integrations/weaviate/src/haystack_integrations/document_stores/weaviate/document_store.py index 09e0a673d..e312b1473 100644 --- a/integrations/weaviate/src/haystack_integrations/document_stores/weaviate/document_store.py +++ b/integrations/weaviate/src/haystack_integrations/document_stores/weaviate/document_store.py @@ -12,7 +12,6 @@ from haystack.dataclasses.document import Document from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError from haystack.document_stores.types.policy import DuplicatePolicy -from haystack.utils.filters import convert import weaviate from weaviate.collections.classes.data import DataObject @@ -388,7 +387,8 @@ def filter_documents(self, filters: Optional[Dict[str, Any]] = None) -> List[Doc :returns: A list of Documents that match the given filters. """ if filters and "operator" not in filters and "conditions" not in filters: - filters = convert(filters) + msg = "Invalid filter syntax. See https://docs.haystack.deepset.ai/docs/metadata-filtering for details." + raise ValueError(msg) result = [] if filters: diff --git a/integrations/weaviate/tests/test_document_store.py b/integrations/weaviate/tests/test_document_store.py index 8d531cade..190c23408 100644 --- a/integrations/weaviate/tests/test_document_store.py +++ b/integrations/weaviate/tests/test_document_store.py @@ -660,15 +660,6 @@ def test_embedding_retrieval_with_distance_and_certainty(self, document_store): with pytest.raises(ValueError): document_store._embedding_retrieval(query_embedding=[], distance=0.1, certainty=0.1) - def test_filter_documents_with_legacy_filters(self, document_store): - docs = [] - for index in range(10): - docs.append(Document(content="This is some content", meta={"index": index})) - document_store.write_documents(docs) - result = document_store.filter_documents({"content": {"$eq": "This is some content"}}) - - assert len(result) == 10 - def test_filter_documents_below_default_limit(self, document_store): docs = [] for index in range(9998):