-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Deprecate legacy filter #8001
Conversation
Pull Request Test Coverage Report for Build 9853471364Details
💛 - Coveralls |
@@ -214,6 +215,12 @@ def convert(filters: Dict[str, Any]) -> Dict[str, Any]: | |||
} | |||
``` | |||
""" | |||
warnings.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we could link to the doc/api with the new syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just a small suggestion
@dfokina do we have a page already where we describe the new filters? |
@vblagoje Are these the old filters? https://docs.haystack.deepset.ai/docs/metadata-filtering and if so, what changed? |
No these are the new ones, thanks @dfokina 🙏 |
@dfokina while at it do we have a policy (practice) to link to docs page from warnings arising in source code? I'm not finding such instances in the code.... |
@vblagoje I also don't know if it's a policy, it was just a nit/suggestion |
@vblagoje I personally think it's useful to link to current docs from these warnings, but let's see case-by-case where it makes sense, and then make it a policy, if it's useful everywhere :) |
Why:
This update aims to encourage users to transition to a new filter syntax by introducing a deprecation warning for the old syntax. This preemptive measure ensures a smoother transition before the old syntax is removed in an upcoming release, thereby maintaining code compatibility and reducing future technical debt.
What:
warnings
module infilters.py
.DeprecationWarning
in theconvert
function indicating the use of deprecated filter syntax.How can it be used:
convert
function is called with the old filter syntax, a warning message will inform users about the deprecation, encouraging them to update their code.How did you test it:
Notes for the reviewer: