Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Oct 4, 2024
1 parent 028a47d commit 0981e8c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions posthog/hogql_queries/insights/trends/aggregation_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _actors_events_query(
},
)

def get_actors_query_orchestrator(self, events_where_clause: ast.Expr, sample_value: ast.RatioExpr):
def get_actors_querye_orchestrator(self, events_where_clause: ast.Expr, sample_value: ast.RatioExpr):
events_query = cast(ast.SelectQuery, self._actors_events_query(events_where_clause, sample_value))
inner_select = cast(ast.SelectQuery, self._actors_inner_select_query())
parent_select = cast(ast.SelectQuery, self._actors_parent_select_query())
Expand All @@ -417,13 +417,13 @@ def build(self):

return QueryOrchestrator()

def _first_time_parent_query(self, inner_query: ast.SelectQuery):
def _first_time_parent_query(self):
aggregation_type = self.select_aggregation()
query = ast.SelectQuery(
select=[
ast.Alias(expr=aggregation_type, alias="total"),
],
select_from=ast.JoinExpr(table=inner_query),
select_from=ast.JoinExpr(table=create_placeholder("events_query")),

Check failure on line 426 in posthog/hogql_queries/insights/trends/aggregation_operations.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Argument "table" to "JoinExpr" has incompatible type "Placeholder"; expected "SelectQuery | SelectUnionQuery | Field | None"
)
query.group_by = []

Expand Down Expand Up @@ -455,7 +455,7 @@ def get_first_time_math_query_orchestrator(
)

events_query = ast.SelectQuery(select=[])
parent_select = self._first_time_parent_query(events_query)
parent_select = self._first_time_parent_query()

class QueryOrchestrator:
events_query_builder: FirstTimeForUserEventsQueryAlternator
Expand All @@ -473,7 +473,7 @@ def __init__(self):
self.parent_query_builder = QueryAlternator(parent_select)

def build(self):
self.events_query_builder.build()
return self.parent_query_builder.build()
events_query = self.events_query_builder.build()
return replace_placeholders(self.parent_query_builder.build(), {"events_query": events_query})

return QueryOrchestrator()

0 comments on commit 0981e8c

Please sign in to comment.