[CLEAN] Synthetic Benchmark PR #103379 - fix(search): Fix handle backslashes in wildcard operators #7
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.
User description
Benchmark PR getsentry#103379
Type: Clean (correct implementation)
Original PR Title: fix(search): Fix handle backslashes in wildcard operators
Original PR Description: When using one of the wildcard operators (contains, starts with, ends with), we need to make sure to properly escape backslashes in order to handle the search correctly.
Original PR URL: getsentry#103379
PR Type
Bug fix, Tests
Description
Fix backslash handling in wildcard operators (contains, starts_with, ends_with)
Add
handle_backslash()function to properly escape backslashes in search valuesUpdate escape validation to allow backslash as valid escape character
Add comprehensive tests for wildcard operators with backslash patterns
Diagram Walkthrough
File Walkthrough
event_search.py
Implement backslash escaping for wildcard operatorssrc/sentry/api/event_search.py
handle_backslash()function to properly escape backslashes inwildcard search values
translate_wildcard_as_clickhouse_pattern()to accept backslash asvalid escape character
handle_backslash()call ingen_wildcard_value()before regexsubstitution
test_organization_group_index.py
Add wildcard operator backslash handling teststests/sentry/issues/endpoints/test_organization_group_index.py
test_wildcard_operator_with_backslash()test method to verifybackslash handling
escaped backslashes
test_organization_events_span_indexed.py
Add span query backslash handling teststests/snuba/api/endpoints/test_organization_events_span_indexed.py
test_wildcard_operator_with_backslash()test method for spanqueries
escaped backslashes
patterns