Skip to content

Commit

Permalink
fix sparse agg
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Chen authored and Rachel Chen committed Feb 14, 2025
1 parent ac24c55 commit 24b3a30
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from datetime import UTC, datetime

from google.protobuf.timestamp_pb2 import Timestamp
from sentry_protos.snuba.v1.attribute_conditional_aggregation_pb2 import (
AttributeConditionalAggregation,
)
from sentry_protos.snuba.v1.endpoint_trace_item_table_pb2 import (
Column,
TraceItemTableRequest,
)
from sentry_protos.snuba.v1.request_common_pb2 import RequestMeta, TraceItemType
from sentry_protos.snuba.v1.trace_item_attribute_pb2 import (
AttributeAggregation,
AttributeKey,
ExtrapolationMode,
Function,
Expand Down Expand Up @@ -44,7 +46,7 @@ def test_basic() -> None:
columns=[
Column(key=AttributeKey(type=AttributeKey.TYPE_STRING, name="location")),
Column(
aggregation=AttributeAggregation(
conditional_aggregation=AttributeConditionalAggregation(
aggregate=Function.FUNCTION_MAX,
key=AttributeKey(
type=AttributeKey.TYPE_DOUBLE, name="my.float.field"
Expand All @@ -54,7 +56,7 @@ def test_basic() -> None:
),
),
Column(
aggregation=AttributeAggregation(
conditional_aggregation=AttributeConditionalAggregation(
aggregate=Function.FUNCTION_AVG,
key=AttributeKey(
type=AttributeKey.TYPE_DOUBLE, name="my.float.field"
Expand All @@ -76,6 +78,7 @@ def test_basic() -> None:
)
transformed = SparseAggregateAttributeTransformer(req).transform()
# filter was set properly
print(transformed.filter)
assert transformed.filter == TraceItemFilter(
and_filter=AndFilter(
filters=[
Expand Down

0 comments on commit 24b3a30

Please sign in to comment.