Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Chen authored and Rachel Chen committed Feb 18, 2025
1 parent f70521a commit ce2571e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 4 additions & 0 deletions snuba/web/rpc/v1/endpoint_trace_item_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def _transform_request(request: TraceItemTableRequest) -> TraceItemTableRequest:


def convert_to_conditional_aggregation(in_msg: TraceItemTableRequest) -> None:
"""
This function adds the equivalent conditional aggregation for every aggregation in each Column or AggregationFilter. We don't add the filter field so outside code logic will set the default condition to true. The purpose of this function is to "transform" every AttributeAggregation to AttributeConditionalAggregation in order to avoid code fragmentation
"""

def _add_conditional_aggregation(
input: Column | AggregationComparisonFilter,
) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2798,12 +2798,6 @@ def _build_sum_attribute_aggregation_column_with_name(name: str) -> Column:

def _build_sum_attribute_conditional_aggregation_column_with_name(name: str) -> Column:
return Column(
aggregation=AttributeAggregation(
aggregate=Function.FUNCTION_SUM,
key=AttributeKey(type=AttributeKey.TYPE_DOUBLE, name=name),
label="sum(" + name + ")",
extrapolation_mode=ExtrapolationMode.EXTRAPOLATION_MODE_NONE,
),
conditional_aggregation=AttributeConditionalAggregation(
aggregate=Function.FUNCTION_SUM,
key=AttributeKey(type=AttributeKey.TYPE_DOUBLE, name=name),
Expand Down

0 comments on commit ce2571e

Please sign in to comment.