mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-12 15:27:06 +00:00
Fix filter syntax validation (#8477)
This commit is contained in:
parent
c7b898994e
commit
811a54a3ef
@ -16,9 +16,9 @@ def raise_on_invalid_filter_syntax(filters: Optional[Dict[str, Any]] = None):
|
||||
"""
|
||||
Raise an error if the filter syntax is invalid.
|
||||
"""
|
||||
if filters and "operator" not in filters and "conditions" not in filters:
|
||||
if filters and ("operator" not in filters or "conditions" not in filters):
|
||||
msg = "Invalid filter syntax. See https://docs.haystack.deepset.ai/docs/metadata-filtering for details."
|
||||
raise ValueError(msg)
|
||||
raise FilterError(msg)
|
||||
|
||||
|
||||
def document_matches_filter(filters: Dict[str, Any], document: Document) -> bool:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user