-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hogql): add funnel hogql actors (#20472)
- Loading branch information
1 parent
6cd02e9
commit c88988c
Showing
19 changed files
with
1,379 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import List | ||
|
||
from posthog.hogql import ast | ||
from posthog.hogql_queries.insights.funnels.funnel import Funnel | ||
|
||
|
||
class FunnelActors(Funnel): | ||
def actor_query( | ||
self, | ||
# extra_fields: Optional[List[str]] = None, | ||
) -> ast.SelectQuery: | ||
select: List[ast.Expr] = [ | ||
ast.Alias(alias="actor_id", expr=ast.Field(chain=["aggregation_target"])), | ||
*self._get_funnel_person_step_events(), | ||
*self._get_timestamp_outer_select(), | ||
# {extra_fields} | ||
] | ||
select_from = ast.JoinExpr(table=self.get_step_counts_query()) | ||
where = self._get_funnel_person_step_condition() | ||
order_by = [ast.OrderExpr(expr=ast.Field(chain=["aggregation_target"]))] | ||
|
||
return ast.SelectQuery( | ||
select=select, | ||
select_from=select_from, | ||
order_by=order_by, | ||
where=where, | ||
# SETTINGS max_ast_elements=1000000, max_expanded_ast_elements=1000000 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.