mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-24 13:38:53 +00:00
Remove Document Store tests with invalid filter (#6375)
This commit is contained in:
parent
0a5b37f3d1
commit
ec3558021e
@ -673,14 +673,6 @@ class LegacyFilterDocumentsSimpleLogicalTest(FilterableDocsFixtureMixin):
|
||||
if "number" in doc.meta and doc.meta["number"] >= 0.0 and doc.meta["number"] <= 2.0
|
||||
]
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_filter_simple_explicit_and_with_multikey_dict(
|
||||
self, document_store: DocumentStore, filterable_docs: List[Document]
|
||||
):
|
||||
document_store.write_documents(filterable_docs)
|
||||
result = document_store.filter_documents(filters={"number": {"$and": {"$gte": 0, "$lte": 2}}})
|
||||
assert result == [doc for doc in filterable_docs if "number" in doc.meta and 0 <= doc.meta["number"] <= 2]
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_filter_simple_explicit_and_with_list(self, document_store: DocumentStore, filterable_docs: List[Document]):
|
||||
document_store.write_documents(filterable_docs)
|
||||
@ -717,22 +709,6 @@ class LegacyFilterDocumentsNestedLogicalTest(FilterableDocsFixtureMixin):
|
||||
```
|
||||
"""
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_filter_nested_explicit_and(self, document_store: DocumentStore, filterable_docs: List[Document]):
|
||||
document_store.write_documents(filterable_docs)
|
||||
filters = {"$and": {"number": {"$and": {"$lte": 2, "$gte": 0}}, "name": {"$in": ["name_0", "name_1"]}}}
|
||||
result = document_store.filter_documents(filters=filters)
|
||||
assert result == [
|
||||
doc
|
||||
for doc in filterable_docs
|
||||
if (
|
||||
"number" in doc.meta
|
||||
and doc.meta["number"] >= 0
|
||||
and doc.meta["number"] <= 2
|
||||
and doc.meta["name"] in ["name_0", "name_1"]
|
||||
)
|
||||
]
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_filter_nested_implicit_and(self, document_store: DocumentStore, filterable_docs: List[Document]):
|
||||
document_store.write_documents(filterable_docs)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user