Browse Source

chore(discover): Clean up args for SnQL count_miserable (#27959)

We'd initially just used FunctionArgs, when we were
figuring out a clean way to resolve args. Just the
follow up clean up to that.
Shruthi 3 years ago
parent
commit
c1ef92d3d1
1 changed files with 2 additions and 12 deletions
  1. 2 12
      src/sentry/search/events/fields.py

+ 2 - 12
src/sentry/search/events/fields.py

@@ -2241,10 +2241,7 @@ class QueryFields(QueryBase):
                 ),
                 SnQLFunction(
                     "count_miserable",
-                    # Using the generic FunctionArg here temporarily till we
-                    # implement a resolver for count columns in SnQL. The only
-                    # column to be passed through here for now is `user`.
-                    required_args=[FunctionArg("column")],
+                    required_args=[ColumnTagArg("column")],
                     optional_args=[NullableNumberRange("satisfaction", 0, None)],
                     calculated_args=[
                         {
@@ -3085,14 +3082,7 @@ class QueryFields(QueryBase):
             )
         col = args["column"]
 
-        return Function(
-            "uniqIf",
-            [
-                self.resolve_field_alias(col) if self.is_field_alias(col) else self.column(col),
-                Function("greater", [lhs, rhs]),
-            ],
-            alias,
-        )
+        return Function("uniqIf", [col, Function("greater", [lhs, rhs])], alias)
 
     def _resolve_user_misery_function(self, args: Mapping[str, str], alias: str) -> SelectType:
         if args["satisfaction"]: