Skip to content

Commit 37e9922

Browse files
authored
feat(eap): Support reading boolean attributes from response (#104063)
1 parent 26d4509 commit 37e9922

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/sentry/snuba/spans_rpc.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from sentry_protos.snuba.v1.request_common_pb2 import PageToken, TraceItemType
1414

1515
from sentry.exceptions import InvalidSearchQuery
16-
from sentry.search.eap.constants import DOUBLE, INT, STRING, SUPPORTED_STATS_TYPES
16+
from sentry.search.eap.constants import BOOLEAN, DOUBLE, INT, STRING, SUPPORTED_STATS_TYPES
1717
from sentry.search.eap.resolver import SearchResolver
1818
from sentry.search.eap.sampling import events_meta_from_rpc_request_meta
1919
from sentry.search.eap.spans.definitions import SPAN_DEFINITIONS
@@ -241,7 +241,12 @@ def run_trace_query(
241241
elif resolved_column.proto_definition.type == DOUBLE:
242242
span[resolved_column.public_alias] = attribute.value.val_double
243243
elif resolved_column.search_type == "boolean":
244-
span[resolved_column.public_alias] = attribute.value.val_int == 1
244+
span[resolved_column.public_alias] = (
245+
attribute.value.val_bool or attribute.value.val_int == 1
246+
)
247+
elif resolved_column.proto_definition.type == BOOLEAN:
248+
span[resolved_column.public_alias] = attribute.value.val_bool
249+
245250
elif resolved_column.proto_definition.type == INT:
246251
span[resolved_column.public_alias] = attribute.value.val_int
247252
if resolved_column.public_alias == "project.id":

0 commit comments

Comments
 (0)