diff --git a/haystack/utils/filters.py b/haystack/utils/filters.py index fe2f7530b2..41eca57277 100644 --- a/haystack/utils/filters.py +++ b/haystack/utils/filters.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 +import warnings from dataclasses import fields from datetime import datetime from typing import Any, Dict, List, Union @@ -214,6 +215,12 @@ def convert(filters: Dict[str, Any]) -> Dict[str, Any]: } ``` """ + warnings.warn( + "You are using deprecated filter syntax. Please use the new filter syntax as described " + "in the documentation. We will attempt to convert your old filter syntax to the new one. The old syntax " + "support will be removed in Haystack 2.5", + DeprecationWarning, + ) if not isinstance(filters, dict): msg = f"Can't convert filters from type '{type(filters)}'" raise ValueError(msg) diff --git a/releasenotes/notes/deprecation-warning-legacy-filter-syntax-2fe61cab5e14ad8e.yaml b/releasenotes/notes/deprecation-warning-legacy-filter-syntax-2fe61cab5e14ad8e.yaml new file mode 100644 index 0000000000..65e271e107 --- /dev/null +++ b/releasenotes/notes/deprecation-warning-legacy-filter-syntax-2fe61cab5e14ad8e.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - | + Added deprecation warning for using old filter syntax. Users are advised to switch to the new filter syntax as the old syntax will be removed 2.5 Haystack release.