|
12 | 12 | from sentry.api.event_search import SearchFilter, SearchKey, SearchValue
|
13 | 13 | from sentry.exceptions import InvalidSearchQuery
|
14 | 14 | from sentry.search.eap.columns import ResolvedColumn, ResolvedFunction
|
15 |
| -from sentry.search.eap.constants import ( |
16 |
| - BOOLEAN, |
17 |
| - DOUBLE, |
18 |
| - FLOAT, |
19 |
| - INT, |
20 |
| - MAX_ROLLUP_POINTS, |
21 |
| - STRING, |
22 |
| - VALID_GRANULARITIES, |
23 |
| -) |
| 15 | +from sentry.search.eap.constants import MAX_ROLLUP_POINTS, VALID_GRANULARITIES |
24 | 16 | from sentry.search.eap.spans import SearchResolver
|
25 | 17 | from sentry.search.eap.types import CONFIDENCES, ConfidenceData, EAPResponse, SearchResolverConfig
|
26 | 18 | from sentry.search.events.fields import get_function_alias, is_function
|
@@ -138,16 +130,7 @@ def run_table_query(
|
138 | 130 |
|
139 | 131 | for index, result in enumerate(column_value.results):
|
140 | 132 | result_value: str | int | float
|
141 |
| - if resolved_column.proto_type == STRING: |
142 |
| - result_value = result.val_str |
143 |
| - elif resolved_column.proto_type == INT: |
144 |
| - result_value = result.val_int |
145 |
| - elif resolved_column.proto_type == FLOAT: |
146 |
| - result_value = result.val_float |
147 |
| - elif resolved_column.proto_type == DOUBLE: |
148 |
| - result_value = result.val_double |
149 |
| - elif resolved_column.proto_type == BOOLEAN: |
150 |
| - result_value = result.val_bool |
| 133 | + result_value = getattr(result, str(result.WhichOneof("value"))) |
151 | 134 | result_value = process_value(result_value)
|
152 | 135 | final_data[index][attribute] = resolved_column.process_column(result_value)
|
153 | 136 | if has_reliability:
|
|
0 commit comments