Skip to content

Commit

Permalink
fix(hogql): throw error for missing actions in funnels (#20867)
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr authored Mar 12, 2024
1 parent 2bd43f2 commit 926d860
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions posthog/hogql_queries/insights/funnels/funnel_event_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ def _entity_expr(self, skip_entity_filter: bool) -> ast.Expr | None:
if isinstance(node, EventsNode) or isinstance(node, FunnelExclusionEventsNode):
events.add(node.event)
elif isinstance(node, ActionsNode) or isinstance(node, FunnelExclusionActionsNode):
action = Action.objects.get(pk=int(node.id), team=team)
events.update(action.get_step_events())
try:
action = Action.objects.get(pk=int(node.id), team=team)
events.update(action.get_step_events())
except Action.DoesNotExist:
raise ValidationError(f"Action ID {node.id} does not exist!")
else:
raise ValidationError("Series and exclusions must be compose of action and event nodes")

Expand Down

0 comments on commit 926d860

Please sign in to comment.