From 4eb6c0861c13c9cba36e9c6c3d6a9041a1166604 Mon Sep 17 00:00:00 2001 From: Rachel Chen Date: Thu, 21 Nov 2024 15:15:46 -0800 Subject: [PATCH 1/3] c --- snuba/web/rpc/common/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snuba/web/rpc/common/common.py b/snuba/web/rpc/common/common.py index 8b02471383..6353386f73 100644 --- a/snuba/web/rpc/common/common.py +++ b/snuba/web/rpc/common/common.py @@ -196,7 +196,7 @@ def get_subscriptable_field(field: Expression) -> SubscriptableReference | None: def attribute_key_to_expression(attr_key: AttributeKey) -> Expression: def _build_label_mapping_key(attr_key: AttributeKey) -> str: - return attr_key.name + " " + AttributeKey.Type.Name(attr_key.type) + return attr_key.name + "_" + AttributeKey.Type.Name(attr_key.type) if attr_key.type == AttributeKey.Type.TYPE_UNSPECIFIED: raise BadSnubaRPCRequestException( From 37906c01ffb27d5fb1a6bd7178003d0b03ace940 Mon Sep 17 00:00:00 2001 From: Rachel Chen Date: Thu, 21 Nov 2024 15:59:39 -0800 Subject: [PATCH 2/3] c --- tests/web/rpc/test_common.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/web/rpc/test_common.py b/tests/web/rpc/test_common.py index 599b79b4b6..ab36e49d06 100644 --- a/tests/web/rpc/test_common.py +++ b/tests/web/rpc/test_common.py @@ -13,7 +13,7 @@ def test_expression_trace_id(self) -> None: type=AttributeKey.TYPE_STRING, name="sentry.trace_id", ), - ) == f.CAST(column("trace_id"), "String", alias="sentry.trace_id TYPE_STRING") + ) == f.CAST(column("trace_id"), "String", alias="sentry.trace_id_TYPE_STRING") def test_timestamp_columns(self) -> None: for col in [ @@ -27,21 +27,21 @@ def test_timestamp_columns(self) -> None: name=col, ), ) == f.CAST( - column(col[len("sentry.") :]), "String", alias=col + " TYPE_STRING" + column(col[len("sentry.") :]), "String", alias=col + "_TYPE_STRING" ) assert attribute_key_to_expression( AttributeKey( type=AttributeKey.TYPE_INT, name=col, ), - ) == f.CAST(column(col[len("sentry.") :]), "Int64", alias=col + " TYPE_INT") + ) == f.CAST(column(col[len("sentry.") :]), "Int64", alias=col + "_TYPE_INT") assert attribute_key_to_expression( AttributeKey( type=AttributeKey.TYPE_FLOAT, name=col, ), ) == f.CAST( - column(col[len("sentry.") :]), "Float64", alias=col + " TYPE_FLOAT" + column(col[len("sentry.") :]), "Float64", alias=col + "_TYPE_FLOAT" ) def test_normalized_col(self) -> None: @@ -62,13 +62,13 @@ def test_attributes(self) -> None: assert attribute_key_to_expression( AttributeKey(type=AttributeKey.TYPE_STRING, name="derp"), ) == SubscriptableReference( - alias="derp TYPE_STRING", column=column("attr_str"), key=literal("derp") + alias="derp_TYPE_STRING", column=column("attr_str"), key=literal("derp") ) assert attribute_key_to_expression( AttributeKey(type=AttributeKey.TYPE_FLOAT, name="derp"), ) == SubscriptableReference( - alias="derp TYPE_FLOAT", column=column("attr_num"), key=literal("derp") + alias="derp_TYPE_FLOAT", column=column("attr_num"), key=literal("derp") ) assert attribute_key_to_expression( @@ -80,7 +80,7 @@ def test_attributes(self) -> None: key=literal("derp"), ), "Int64", - alias="derp TYPE_INT", + alias="derp_TYPE_INT", ) assert attribute_key_to_expression( @@ -92,5 +92,5 @@ def test_attributes(self) -> None: key=literal("derp"), ), "Boolean", - alias="derp TYPE_BOOLEAN", + alias="derp_TYPE_BOOLEAN", ) From f8f06bbbd97e24f5a46a0cfd544f0c2bd9055280 Mon Sep 17 00:00:00 2001 From: Rachel Chen Date: Thu, 21 Nov 2024 23:37:58 -0800 Subject: [PATCH 3/3] ci