Skip to content

Commit

Permalink
ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Mar 26, 2024
1 parent 7c9f4a1 commit d873b76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions posthog/hogql/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ class SelectQueryAliasType(Type):
def get_child(self, name: str, context: HogQLContext) -> Type:
if name == "*":
return AsteriskType(table_type=self)
if self.select_query_type.has_child(name, context):
return FieldType(name=name, table_type=self)
if self.view_name:
if context.database is None:
raise HogQLException("Database must be set for queries with views")
Expand All @@ -209,8 +211,6 @@ def get_child(self, name: str, context: HogQLContext) -> Type:
if isinstance(field, ExpressionField):
return ExpressionFieldType(table_type=self, name=name, expr=field.expr)
return FieldType(name=name, table_type=self)
if self.select_query_type.has_child(name, context):
return FieldType(name=name, table_type=self)
raise HogQLException(f"Field {name} not found on query with alias {self.alias}")

def has_child(self, name: str, context: HogQLContext) -> bool:
Expand Down

0 comments on commit d873b76

Please sign in to comment.