Skip to content

Commit

Permalink
chore: remove event properties from subquery (#24616)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Aug 28, 2024
1 parent 520bd99 commit 56b91d1
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 11 deletions.
7 changes: 0 additions & 7 deletions posthog/models/filters/mixins/session_recordings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ class SessionRecordingsMixin(PropertyMixin, BaseParamMixin):
def order(self) -> str:
return self._data.get("order", "start_time")

# Supports a legacy use case where events were ORed not ANDed
# Can be removed and replaced with ast_operand once the new universal replay filtering is out
@cached_property
def events_operand(self) -> type[Union[ast.And, ast.Or]]:
operand = self._data.get("operand", "OR")
return ast.And if operand == "AND" else ast.Or

@cached_property
def console_log_filters(self) -> PropertyGroup:
property_group = self._parse_data(key="console_log_filters")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ def _where_predicates(self) -> ast.Expr:

(event_where_exprs, _) = self._event_predicates
if event_where_exprs:
exprs.append(self._filter.events_operand(exprs=event_where_exprs))
# we OR all events in the where and use hasAll / hasAny in the HAVING clause
exprs.append(ast.Or(exprs=event_where_exprs))

if self._team.person_on_events_mode and self.person_properties:
exprs.append(property_to_expr(self.person_properties, team=self._team, scope="event"))
Expand Down
Loading

0 comments on commit 56b91d1

Please sign in to comment.