Skip to content

Commit b8f98db

Browse files
ref: remove try: around parse_percentage
given the parser input values it cannot fail
1 parent 0b5e044 commit b8f98db

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/sentry/api/event_search.py

+5-14
Original file line numberDiff line numberDiff line change
@@ -999,20 +999,11 @@ def visit_aggregate_percentage_filter(self, node, children):
999999
(negation, search_key, _, operator, search_value) = children
10001000
operator = handle_negation(negation, operator)
10011001

1002-
aggregate_value = None
1003-
1004-
try:
1005-
# Even if the search value matches percentage format, only act as
1006-
# percentage for certain columns
1007-
result_type = self.get_function_result_type(search_key.name)
1008-
if result_type == "percentage":
1009-
aggregate_value = parse_percentage(search_value)
1010-
except ValueError:
1011-
raise InvalidSearchQuery(f"Invalid aggregate query condition: {search_key}")
1012-
except InvalidQuery as exc:
1013-
raise InvalidSearchQuery(str(exc))
1014-
1015-
if aggregate_value is not None:
1002+
# Even if the search value matches percentage format, only act as
1003+
# percentage for certain columns
1004+
result_type = self.get_function_result_type(search_key.name)
1005+
if result_type == "percentage":
1006+
aggregate_value = parse_percentage(search_value)
10161007
return AggregateFilter(search_key, operator, SearchValue(aggregate_value))
10171008

10181009
# Invalid formats fall back to text match

0 commit comments

Comments
 (0)