-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Add backend logic for column filtering #35846
Open
biyeun
wants to merge
19
commits into
master
Choose a base branch
from
bmb/dc/filtering
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+902
−24
Conversation
This file contains 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
instead, CaseSearchES supports the concept of empty (both '' and unset values) and missing (unset values only). Update NULL, NOT_NULL to be missing, not missing
this will make determining any related operators more straightforward additionally, CaseSearchES xpath_query does not support <, >, <=, >= comparitors for text...only date and number
…are displayed for a given data type
applies to match_types that are not in FilterMatchTypes.ALL_DATA_TYPES_CHOICES
this makes reordering easier (as we just need to pass in reordered list of UUIDs to update the index) Additionally, it is more secure than just passing the pk, as that shows how many BulkEditColumns are available in the db.
- column_id to BulkEditColumn - filter_id to BulkEditColumnFilter - updates to FilterMatchType choices
nospame
reviewed
Feb 26, 2025
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.
I don't feel like I have a full understanding of how this will be used, but the code all looks good to me. Couple nitpicks, with the note on UnsupportedFilterValueException
as the only one I'd for sure like to see fixed before approving.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
product/feature-flag
Change will only affect users who have a specific feature flag enabled
reindex/migration
Reindex or migration will be required during or before deploy
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.
Technical Summary
This PR implements the backend logic for filtering a
CaseSearchES
query based on theBulkEditColumnFilters
associated with aBulkEditSession
.Review commit-by-commit.
While working on this I discovered a few issues with our current model definitions:
xpath_query
does not support an "ends with" so I replaced it withnot(starts-with(...))
lte
(<=
) andgte
(>=
) match typesxpath_query
does not support<
,>
,<=
, and>=
for text, only dates and numbersxpath_query
has some limitations due to ourxpath
parser if the value contains mixed quotes ("
and'
), so I made sure to check for this.I believe we can and should move away from
xpath_query
when we implement forms, as there is no equivalent filter available forFormES
. I opted to usexpath_query
, even with its limitations, because it was the fastest way forward to a usable feature for most scenarios if we're just dealing with case data.Additionally, I added utilities to
BulkEditSession
to:We then use the filtered query set from the session in
CleanCasesTableView
.Feature Flag
DATA_CLEANING_CASES
Safety Assurance
Safety story
safe. everything here is feature flagged and not part of production workflows
Automated test coverage
Yes, and lots of new tests added.
QA Plan
Not needed at this point
Migrations
Rollback instructions
Labels & Review