Skip to content

Commit

Permalink
chore: MongoDB - remove legacy filter support (#1066)
Browse files Browse the repository at this point in the history
* Remove legacy filter support

* Lint

* Add _normalize_filters

* Lint all

* Linting issues

* Error msg fmt
  • Loading branch information
vblagoje authored and Amnah199 committed Oct 2, 2024
1 parent 9d3a261 commit cde2f1d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Any, Dict

from haystack.errors import FilterError
from haystack.utils.filters import convert
from pandas import DataFrame

UNSUPPORTED_TYPES_FOR_COMPARISON = (list, DataFrame)
Expand All @@ -20,7 +19,8 @@ def _normalize_filters(filters: Dict[str, Any]) -> Dict[str, Any]:
raise FilterError(msg)

if "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)

if "field" in filters:
return _parse_comparison_condition(filters)
Expand Down

0 comments on commit cde2f1d

Please sign in to comment.