Open
Conversation
✅ Deploy Preview for fastapi-filter ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #551 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 193 196 +3
=========================================
+ Hits 193 196 +3
|
butorov
reviewed
May 15, 2024
| "isnull": lambda value: ("is_", None) if value is True else ("is_not", None), | ||
| "lt": lambda value: ("__lt__", value), | ||
| "lte": lambda value: ("__le__", value), | ||
| "between": lambda value: ("between", (value[0], value[1])), |
There was a problem hiding this comment.
It would be beneficial to enhance protection against IndexError. For instance, if a client passes __between=21, instead of between=21,33.
butorov
reviewed
May 15, 2024
| age__gt: Optional[int] = None | ||
| age__gte: Optional[int] = None | ||
| age__in: Optional[List[int]] = None | ||
| age__between: Optional[List[int]] = None |
There was a problem hiding this comment.
The type annotation here and in examples/fastapi_filter_sqlalchemy.py:105 (List[List[int]]) differs. Is this a mistake?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to expose the between() operator present in SQLAlchemy.
While the conjunction of
lteandgteoperators can suffice when dealing with numerical columns this opens the possibility of using the operator also on textual and date columns with a single operator.The proposed implementation asks the user to input a list, the first two element are considered the right and left sides of the queried interval. If more than two elements are present they are simply ignored.