File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
src/sentry/search/eap/processing_errors Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 99 AttributeArgumentDefinition ,
1010 count_argument_resolver_optimized ,
1111)
12+ from sentry .search .eap .common_aggregates import count_unique_aggregate_definition
1213
1314PROCESSING_ERRORS_ALWAYS_PRESENT_ATTRIBUTES = [
1415 AttributeKey (name = "error_type" , type = AttributeKey .Type .TYPE_STRING ),
3435 PROCESSING_ERRORS_ALWAYS_PRESENT_ATTRIBUTES
3536 ),
3637 ),
38+ "count_unique" : count_unique_aggregate_definition (default_arg = "event_id" ),
3739}
Original file line number Diff line number Diff line change 11from unittest import TestCase
22
33from sentry_protos .snuba .v1 .trace_item_attribute_pb2 import (
4+ AttributeAggregation ,
45 AttributeKey ,
56 AttributeValue ,
7+ ExtrapolationMode ,
8+ Function ,
69 StrArray ,
710)
811from sentry_protos .snuba .v1 .trace_item_filter_pb2 import (
@@ -137,3 +140,13 @@ def test_none_query(self) -> None:
137140 where , having , _ = self .resolver .resolve_query (None )
138141 assert where is None
139142 assert having is None
143+
144+ def test_count_unique (self ) -> None :
145+ resolved_column , virtual_context = self .resolver .resolve_column ("count_unique(event_id)" )
146+ assert resolved_column .proto_definition == AttributeAggregation (
147+ aggregate = Function .FUNCTION_UNIQ ,
148+ key = AttributeKey (name = "event_id" , type = AttributeKey .Type .TYPE_STRING ),
149+ label = "count_unique(event_id)" ,
150+ extrapolation_mode = ExtrapolationMode .EXTRAPOLATION_MODE_SAMPLE_WEIGHTED ,
151+ )
152+ assert virtual_context is None
You can’t perform that action at this time.
0 commit comments