-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
added contains express support #395
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for fastapi-filter ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
Hey @iakashpatel 👋🏻
Thanks for the contribution, this seems useful for more that just the scalar list type, thanks for adding it 👍🏻
However, the tests you have updated don't test the actual feature you are looking for. Could you update the tests as mentioned in the comments?
[{"is_individual": True, "bogus_filter": "bad"}, status.HTTP_422_UNPROCESSABLE_ENTITY], | ||
[{"is_individual": True, "bogus_filter": "bad"}, | ||
status.HTTP_422_UNPROCESSABLE_ENTITY], |
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.
This should be reverted.
@@ -265,6 +265,7 @@ class UserFilter(Filter): # type: ignore[misc, valid-type] | |||
name: Optional[str] | |||
name__neq: Optional[str] | |||
name__like: Optional[str] | |||
name__contains: Optional[str] |
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.
Here name
is not a list of enum so I'm not sure we are testing exactly what you are looking for... Could you add another enum
list field instead and test against it?
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #395 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 180 180
=========================================
Hits 180 180
|
Hi @iakashpatel , I'm interested in the same feature, and was wondering if you still planned to work on this PR ? If not I might consider opening one myself |
Why this PR?
Recently I started using https://sqlalchemy-utils.readthedocs.io/en/latest/_modules/sqlalchemy_utils/types/scalar_list.html to store array of enum.
for which I need to filter table with specific value inside array of enum (TEXT/BLOB at low level) which is feasible using
contains
expression.What is changed/added ?
contains
expression support forsqlalchemy
and testcases to support it.PS: 🌟 My first open-source contribution :)