diff --git a/snuba/web/rpc/common/common.py b/snuba/web/rpc/common/common.py index aecbc770330..7ebbe4b8453 100644 --- a/snuba/web/rpc/common/common.py +++ b/snuba/web/rpc/common/common.py @@ -232,8 +232,15 @@ def attribute_key_to_expression(attr_key: AttributeKey) -> Expression: # End of special handling, just send to the appropriate bucket if attr_key.type == AttributeKey.Type.TYPE_STRING: - return SubscriptableReference( - alias=alias, column=column("attr_str"), key=literal(attr_key.name) + # return SubscriptableReference( + # alias=alias, column=column("attr_str"), key=literal(attr_key.name) + # ) + return f.CAST( + SubscriptableReference( + alias=None, column=column("attr_str"), key=literal(attr_key.name) + ), + "String", + alias=alias, ) if attr_key.type == AttributeKey.Type.TYPE_FLOAT: return SubscriptableReference(