Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Chen authored and Rachel Chen committed Jan 17, 2025
1 parent 349f28b commit 0c4fba3
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions src/sentry/snuba/spans_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@
from sentry.api.event_search import SearchFilter, SearchKey, SearchValue
from sentry.exceptions import InvalidSearchQuery
from sentry.search.eap.columns import ResolvedColumn, ResolvedFunction
from sentry.search.eap.constants import (
BOOLEAN,
DOUBLE,
FLOAT,
INT,
MAX_ROLLUP_POINTS,
STRING,
VALID_GRANULARITIES,
)
from sentry.search.eap.constants import MAX_ROLLUP_POINTS, VALID_GRANULARITIES
from sentry.search.eap.spans import SearchResolver
from sentry.search.eap.types import CONFIDENCES, ConfidenceData, EAPResponse, SearchResolverConfig
from sentry.search.events.fields import get_function_alias, is_function
Expand Down Expand Up @@ -137,16 +129,20 @@ def run_table_query(

for index, result in enumerate(column_value.results):
result_value: str | int | float
if resolved_column.proto_type == STRING:
result_value = result.val_str
elif resolved_column.proto_type == INT:
result_value = result.val_int
elif resolved_column.proto_type == FLOAT:
result_value = result.val_float
elif resolved_column.proto_type == DOUBLE:
result_value = result.val_double
elif resolved_column.proto_type == BOOLEAN:
result_value = result.val_bool
value_type = result.WhichOneof("value")
match value_type:
case "val_str":
result_value = result.val_str
case "val_int":
result_value = result.val_int
case "val_float":
result_value = result.val_float
case "val_double":
result_value = result.val_double
case "val_bool":
result_value = result.val_bool
case default:
raise NotImplementedError(f"received unhandlable AttributeValue type {default}")
result_value = process_value(result_value)
final_data[index][attribute] = resolved_column.process_column(result_value)
if has_reliability:
Expand Down

0 comments on commit 0c4fba3

Please sign in to comment.