Skip to content

Commit

Permalink
fix(eap-api): string equality ignoring case
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Chen authored and Rachel Chen committed Jan 27, 2025
1 parent 07d135c commit ac66e82
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion snuba/web/rpc/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ def trace_item_filters_to_expression(item_filter: TraceItemFilter) -> Expression
case "val_bool":
v_expression: Expression = literal(v.val_bool)
case "val_str":
v_expression = literal(v.val_str)
v_expression = (
literal(v.val_str.lower())
if item_filter.comparison_filter.ignore_case
else literal(v.val_str)
)
case "val_float":
v_expression = literal(v.val_float)
case "val_double":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def trace_item_filters_to_expression(item_filter: TraceItemFilter) -> Expression
case "val_bool":
v_expression: Expression = literal(v.val_bool)
case "val_str":
v_expression = literal(v.val_str)
v_expression = (
literal(v.val_str.lower())
if item_filter.comparison_filter.ignore_case
else literal(v.val_str)
)
case "val_float":
v_expression = literal(v.val_float)
case "val_int":
Expand Down
6 changes: 5 additions & 1 deletion snuba/web/rpc/v1/resolvers/R_uptime_checks/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ def trace_item_filters_to_expression(item_filter: TraceItemFilter) -> Expression
case "val_bool":
v_expression: Expression = literal(v.val_bool)
case "val_str":
v_expression = literal(v.val_str)
v_expression = (
literal(v.val_str.lower())
if item_filter.comparison_filter.ignore_case
else literal(v.val_str)
)
case "val_float":
v_expression = literal(v.val_float)
case "val_double":
Expand Down

0 comments on commit ac66e82

Please sign in to comment.