Skip to content

Commit

Permalink
receiving
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Chen authored and Rachel Chen committed Jan 16, 2025
1 parent 9f6bc7b commit 60e425d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
50 changes: 25 additions & 25 deletions src/sentry/search/eap/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,32 @@
# TODO: we need a datetime type
# Maps search types back to types for the proto
TYPE_MAP: dict[SearchType, AttributeKey.Type.ValueType] = {
"bit": DOUBLE,
"byte": DOUBLE,
"kibibyte": DOUBLE,
"mebibyte": DOUBLE,
"gibibyte": DOUBLE,
"tebibyte": DOUBLE,
"pebibyte": DOUBLE,
"exbibyte": DOUBLE,
"kilobyte": DOUBLE,
"megabyte": DOUBLE,
"gigabyte": DOUBLE,
"terabyte": DOUBLE,
"petabyte": DOUBLE,
"exabyte": DOUBLE,
"nanosecond": DOUBLE,
"microsecond": DOUBLE,
"millisecond": DOUBLE,
"second": DOUBLE,
"minute": DOUBLE,
"hour": DOUBLE,
"day": DOUBLE,
"week": DOUBLE,
"duration": DOUBLE,
"bit": FLOAT,
"byte": FLOAT,
"kibibyte": FLOAT,
"mebibyte": FLOAT,
"gibibyte": FLOAT,
"tebibyte": FLOAT,
"pebibyte": FLOAT,
"exbibyte": FLOAT,
"kilobyte": FLOAT,
"megabyte": FLOAT,
"gigabyte": FLOAT,
"terabyte": FLOAT,
"petabyte": FLOAT,
"exabyte": FLOAT,
"nanosecond": FLOAT,
"microsecond": FLOAT,
"millisecond": FLOAT,
"second": FLOAT,
"minute": FLOAT,
"hour": FLOAT,
"day": FLOAT,
"week": FLOAT,
"duration": FLOAT,
"integer": INT,
"number": DOUBLE,
"percentage": DOUBLE,
"number": FLOAT,
"percentage": FLOAT,
"string": STRING,
"boolean": BOOLEAN,
}
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/search/eap/spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def _resolve_search_value(
)
elif isinstance(value, (float, int)):
return AttributeValue(val_int=int(value))
elif column_type == constants.DOUBLE:
elif column_type == constants.FLOAT:
if operator in constants.IN_OPERATORS:
if isinstance(value, list):
return AttributeValue(
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/snuba/spans_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from sentry.search.eap.constants import (
BOOLEAN,
DOUBLE,
FLOAT,
INT,
MAX_ROLLUP_POINTS,
STRING,
Expand Down Expand Up @@ -140,7 +141,7 @@ def run_table_query(
result_value = result.val_str
elif resolved_column.proto_type == INT:
result_value = result.val_int
elif resolved_column.proto_type == DOUBLE:
elif resolved_column.proto_type == DOUBLE or resolved_column.proto_type == FLOAT:
if result.WhichOneof("value") == "val_float":
result_value = result.val_float
if result.WhichOneof("value") == "val_double":
Expand Down

0 comments on commit 60e425d

Please sign in to comment.