:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
perf(replay): combine positive event filters behind a flag (#106327)
Paul D'Ambra209cdc538574
diff --git a/posthog/clickhouse/query_tagging.py b/posthog/clickhouse/query_tagging.pyindex 003b9061da6c..2d921780f572 100644--- a/posthog/clickhouse/query_tagging.py+++ b/posthog/clickhouse/query_tagging.py@@ -7,7 +7,7 @@ import contextvarsfrom collections.abc import Generatorfrom contextlib import contextmanager, suppressfrom enum import StrEnum-from typing import TYPE_CHECKING, Any, NotRequired, Optional, TypedDict, assert_never+from typing import TYPE_CHECKING, Any, Literal, NotRequired, Optional, TypedDict, assert_neverif TYPE_CHECKING:from posthog.models.team import Team@@ -496,6 +496,13 @@ class QueryTags(BaseModel):# in-session exposure evidence, which adds a live events scan and a GLOBAL IN set on top of the# population read. Separates that heavier read from a plain exposure listing in the query log.experiment_exposures_in_session: Optional[bool] = None+ # Set on recordings-list reads with positive events-table filters, to compare the combined scan.+ replay_event_query_strategy: Optional[Literal["separate", "combined"]] = None+ replay_event_filter_count: Optional[int] = None+ replay_event_query_property_filter_count: Optional[int] = None+ replay_combined_event_query_eligible: Optional[bool] = None+ replay_event_query_operand: Optional[Literal["AND", "OR"]] = None+ replay_event_query_range_days: Optional[float] = Noneexperiment_metric_events_path: Optional[str] = None # "direct_scan", "precomputed", or "not_applicable"experiment_query_surface: Optional[str] = None # "metric", "exposures_timeseries", "actors", "precompute_build"experiment_precompute_table: Optional[str] = None # on precompute_build rows: "exposures" or "metric_events"diff --git a/posthog/session_recordings/queries/session_recording_list_from_query.py b/posthog/session_recordings/queries/session_recording_list_from_query.pyindex b308024a8a0f..9e358dad96be 100644--- a/posthog/session_recordings/queries/session_recording_list_from_query.py+++ b/posthog/session_recordings/queries/session_recording_list_from_query.py@@ -29,7 +29,10 @@ from posthog.models import Team, Userfrom posthog.session_recordings.models.metadata import ONGOING_SESSION_WINDOW_MINUTESfrom posthog.session_recordings.queries.sub_queries.base_query import SessionRecordingsListingBaseQueryfrom posthog.session_recordings.queries.sub_queries.cohort_subquery import CohortPropertyGroupsSubQuery-from posthog.session_recordings.queries.sub_queries.events_subquery import ReplayFiltersEventsSubQuery+from posthog.session_recordings.queries.sub_queries.events_subquery import (+ ReplayFiltersEventsSubQuery,+ SessionIdMatchPlan,+)from posthog.session_recordings.queries.sub_queries.person_ids_subquery import PersonsIdCompareOperationfrom posthog.session_recordings.queries.sub_queries.person_props_subquery import PersonsPropertiesSubQueryfrom posthog.session_recordings.queries.utils import (@@ -159,6 +162,9 @@ class SessionRecordingListFromQuery(SessionRecordingsListingBaseQuery):# Opt-in: resolve group property filters to group keys instead of joining the groups table.# Naming the ClickHouse user is the opt-in, since the resolution is itself a heavy query.resolve_group_properties: ClickHouseUser | None = None,+ # Opt-in for the flagged combined event scan. Only the recordings list opts in, so deletes and+ # background scans keep the separate queries while the flag is tested.+ allow_combined_event_filters: bool = False,**_,):self._user = user@@ -169,6 +175,8 @@ class SessionRecordingListFromQuery(SessionRecordingsListingBaseQuery):self._events_timestamp_floor = events_timestamp_floorself._resolve_group_properties = resolve_group_propertiesself.events_subqueries_sampled = False+ self._allow_combined_event_filters = allow_combined_event_filters+ self._event_match_plan: SessionIdMatchPlan | None = Noneself._bypass_date_window_for_session_ids = bypass_date_window_for_session_ids# TRICKY: we need to make sure we init test account filters only once,# otherwise we'll end up with a lot of duplicated test account filters in the query@@ -276,7 +284,20 @@ class SessionRecordingListFromQuery(SessionRecordingsListingBaseQuery):# Tagged around the listing execution only, so the tag marks exactly the queries that# carry the evidence scan and its GLOBAL IN set: the precompute builds that run during# linkage resolution and the blocklist probe below stay untagged.- with tags_context(**({"experiment_exposures_in_session": True} if in_session_narrowed else {})):+ listing_tags: dict[str, Any] = {}+ if in_session_narrowed:+ listing_tags["experiment_exposures_in_session"] = True+ plan = self._event_match_plan+ if plan is not None and plan.filter_count:+ listing_tags["replay_event_query_strategy"] = plan.strategy+ listing_tags["replay_event_filter_count"] = plan.filter_count+ listing_tags["replay_event_query_property_filter_count"] = plan.property_filter_count+ listing_tags["replay_combined_event_query_eligible"] = plan.combined_eligible+ listing_tags["replay_event_query_operand"] = self._query.operand+ listing_tags["replay_event_query_range_days"] = (+ self.query_date_range.date_to() - self.query_date_range.date_from()+ ).total_seconds() / 86400+ with tags_context(**listing_tags):paginated_response = self._paginator.execute_hogql_query(# TODO I guess the paginator needs to know how to handle union queries or all callers are supposed to collapse them or .... 🤷query=cast(ast.SelectQuery, query),@@ -663,8 +684,10 @@ class SessionRecordingListFromQuery(SessionRecordingsListingBaseQuery):events_timestamp_floor=self._events_timestamp_floor,resolve_group_properties=self._resolve_group_properties,)- events_sub_queries = events_sub_query_builder.get_queries_for_session_id_matching()- for events_sub_query in events_sub_queries:+ self._event_match_plan = events_sub_query_builder.get_session_id_match_plan(+ allow_combined_filters=self._allow_combined_event_filters+ )+ for events_sub_query in self._event_match_plan.queries:optional_exprs.append(ast.CompareOperation(# this hits the distributed events table from the distributed session_replay_events tablediff --git a/posthog/session_recordings/queries/sub_queries/events_subquery.py b/posthog/session_recordings/queries/sub_queries/events_subquery.pyindex eade999290f3..514aef2e845a 100644--- a/posthog/session_recordings/queries/sub_queries/events_subquery.py+++ b/posthog/session_recordings/queries/sub_queries/events_subquery.py@@ -1,6 +1,6 @@from collections.abc import Iterablefrom datetime import datetime, timedelta-from typing import Any, Optional, cast+from typing import Any, Literal, Optional, castimport posthoganalyticsfrom prometheus_client import Counter@@ -18,14 +18,16 @@ from posthog.schema import ()from posthog.hogql import ast+from posthog.hogql.parser import parse_exprfrom posthog.hogql.property import property_to_exprfrom posthog.hogql.query import execute_hogql_query, tracerfrom posthog.clickhouse.client.connection import ClickHouseUserfrom posthog.clickhouse.query_tagging import Feature, Product, tag_queriesfrom posthog.constants import TREND_FILTER_TYPE_ACTIONS, TREND_FILTER_TYPE_DATA_WAREHOUSE, TREND_FILTER_TYPE_EVENTS+from posthog.dataclasses import frozenfrom posthog.models import EventProperty, Team-from posthog.ph_client import feature_enabled_or_false+from posthog.ph_client import feature_enabled_or_false, get_feature_flag_or_nonefrom posthog.session_recordings.queries.sub_queries.base_query import SessionRecordingsListingBaseQueryfrom posthog.session_recordings.queries.sub_queries.group_key_resolver import resolved_group_key_exprfrom posthog.session_recordings.queries.utils import (@@ -41,6 +43,7 @@ from posthog.session_recordings.queries.utils import (is_person_property,)from posthog.types import AnyPropertyFilter+from posthog.utils import get_instance_regionENTITY_TYPES_ACCEPTED_BY_LEGACY_ENTITY = frozenset({TREND_FILTER_TYPE_ACTIONS, TREND_FILTER_TYPE_DATA_WAREHOUSE, TREND_FILTER_TYPE_EVENTS}@@ -55,6 +58,9 @@ REPLAY_NEGATIVE_BLOCKLIST_TRUNCATED_COUNTER = Counter("A replay exclusion blocklist hit its row cap, so some sessions were not excluded from the results",)+COMBINED_EVENT_FILTERS_FLAG = "replay-combined-event-filters"+EVENTS_SUBQUERY_ROW_LIMIT = 1_000_000+# Modes where events.person_id is resolved through person_distinct_id_overrides, so it follows# a person merge instead of reporting whoever the event was attributed to at ingest.PERSON_ID_OVERRIDE_MODES = frozenset(@@ -93,6 +99,17 @@ def get_negative_entity_properties(return negative_props+@frozen+class SessionIdMatchPlan:+ queries: list[ast.SelectQuery]+ strategy: Literal["separate", "combined"]+ filter_count: int+ # Filters that carry an event property. When 0 < this < filter_count, the combined scan also+ # reads properties for the plain event filters, which the separate scans never needed.+ property_filter_count: int+ combined_eligible: bool++class ReplayFiltersEventsSubQuery(SessionRecordingsListingBaseQuery):def __init__(self,@@ -438,6 +455,65 @@ class ReplayFiltersEventsSubQuery(SessionRecordingsListingBaseQuery):))+ def _can_combine_session_filters(self, filter_count: int) -> bool:+ if (+ filter_count < 2+ or self._sample_factor is not None+ or self._events_timestamp_floor is not None+ or self._query.actions+ or any(not isinstance(entity, EventsNode) for entity in self.entities)+ or self.negated_entities+ or self.person_properties+ or self.group_properties+ or self.cohort_properties+ ):+ return False++ properties = self.event_properties + [p for entity in self.entities for p in entity.properties or []]+ return all(isinstance(prop, EventPropertyFilter) and not is_negative_prop(prop) for prop in properties)++ def _emitted_event_properties(self) -> list[AnyPropertyFilter]:+ # With operand AND, _negative_blocklist_query handles the negative event properties.+ if self._query.operand == "AND":+ return [p for p in self.event_properties if not is_negative_prop(p)]+ return self.event_properties++ def _property_filter_count(self) -> int:+ return len(self._emitted_event_properties()) + sum(1 for entity in self.entities if entity.properties)++ def _combined_filters_enabled(self) -> bool:+ return (+ get_feature_flag_or_none(+ COMBINED_EVENT_FILTERS_FLAG,+ str(self._team.pk),+ person_properties={"region": get_instance_region()},+ only_evaluate_locally=True,+ send_feature_flag_events=False,+ )+ is True+ )++ def _combined_session_query(self, predicates: list[ast.Expr]) -> ast.SelectQuery:+ is_or = self.property_operand == "OR"+ return ast.SelectQuery(+ select=[ast.Alias(alias="session_id", expr=_event_session_id_field())],+ select_from=self._events_join(),+ where=self._where_predicates(ast.Or(exprs=predicates)),+ group_by=[_event_session_id_field()],+ # For OR, the WHERE already requires one matching predicate per row.+ having=None+ if is_or+ else ast.And(+ exprs=[+ parse_expr("max(ifNull({predicate}, false))", placeholders={"predicate": predicate})+ for predicate in predicates+ ]+ ),+ # The separate path caps each filter's set. An OR union of those sets can hold up to one cap+ # per filter, so the combined OR gets the same total. Capped results can still differ.+ limit=ast.Constant(value=EVENTS_SUBQUERY_ROW_LIMIT * (len(predicates) if is_or else 1)),+ )+def _get_queries_for_matching(self, select_expr: ast.Expr, group_by: list[ast.Expr], union_entities: bool = False) -> list[ast.SelectQuery]:@@ -447,11 +523,16 @@ class ReplayFiltersEventsSubQuery(SessionRecordingsListingBaseQuery):this might be slower than the previous approach of having one huge event querybut that approach is horribly complex, and we keep getting bug reportsthat are avoidable with a simpler approach+ `get_session_id_match_plan` can combine a narrow set of positive filters behind a release flag.`union_entities` merges the event/action filters into a single subquery, for callers thatintersect the subqueries by event id rather than by session id (see`get_query_for_event_id_matching`)."""+ gathered_exprs, hybrid_query = self._gathered_exprs(union_entities)+ return self._separate_queries(select_expr, group_by, gathered_exprs, hybrid_query)++ def _gathered_exprs(self, union_entities: bool) -> tuple[list[ast.Expr], Optional[ast.SelectQuery]]:gathered_exprs: list[ast.Expr] = []event_where_exprs = self._event_predicates(self.entities, self._team)if event_where_exprs:@@ -461,13 +542,10 @@ class ReplayFiltersEventsSubQuery(SessionRecordingsListingBaseQuery):else event_where_exprs)- # Skip event properties with negative operators since they're handled by _negative_guard_query+ # With operand AND, _negative_blocklist_query handles negative group and person propertiesskip_negative_properties = self._query.operand == "AND"- for p in self.event_properties:- if skip_negative_properties and is_negative_prop(p):- continue-+ for p in self._emitted_event_properties():if self._allow_event_property_expansion:events_seen_with_this_property, property_expr = self.with_team_events_added(p, self._team)gathered_exprs.append(@@ -532,6 +610,15 @@ class ReplayFiltersEventsSubQuery(SessionRecordingsListingBaseQuery):continuegathered_exprs.append(property_to_expr(p, team=self._team, scope="event"))+ return gathered_exprs, hybrid_query++ def _separate_queries(+ self,+ select_expr: ast.Expr,+ group_by: list[ast.Expr],+ gathered_exprs: list[ast.Expr],+ hybrid_query: Optional[ast.SelectQuery],+ ) -> list[ast.SelectQuery]:queries: list[ast.SelectQuery] = []# Add hybrid query first if we used it for person properties@@ -543,15 +630,36 @@ class ReplayFiltersEventsSubQuery(SessionRecordingsListingBaseQuery):# 2. Replay was recently disabled (recent sessions have no recordings)# With the original 10000 limit, we might miss all sessions that actually have recordings.queries.append(- self._select_from_events(select_expr, expr, group_by=group_by, limit_expr=ast.Constant(value=1000000))+ self._select_from_events(+ select_expr, expr, group_by=group_by, limit_expr=ast.Constant(value=EVENTS_SUBQUERY_ROW_LIMIT)+ ))return queriesdef get_queries_for_session_id_matching(self) -> list[ast.SelectQuery]:- return self._get_queries_for_matching(- select_expr=ast.Alias(alias="session_id", expr=_event_session_id_field()),- group_by=[_event_session_id_field()],+ return self.get_session_id_match_plan().queries++ def get_session_id_match_plan(self, allow_combined_filters: bool = False) -> SessionIdMatchPlan:+ gathered_exprs, hybrid_query = self._gathered_exprs(union_entities=False)+ eligible = allow_combined_filters and self._can_combine_session_filters(len(gathered_exprs))+ combined = eligible and self._combined_filters_enabled()+ queries = (+ [self._combined_session_query(gathered_exprs)]+ if combined+ else self._separate_queries(+ ast.Alias(alias="session_id", expr=_event_session_id_field()),+ [_event_session_id_field()],+ gathered_exprs,+ hybrid_query,+ )+ )+ return SessionIdMatchPlan(+ queries=queries,+ strategy="combined" if combined else "separate",+ filter_count=len(gathered_exprs),+ property_filter_count=self._property_filter_count(),+ combined_eligible=eligible,)def get_negative_blocklist_query(self) -> ast.SelectQuery | None:diff --git a/posthog/session_recordings/queries/test/listing_recordings/test_session_recording_list_from_query.py b/posthog/session_recordings/queries/test/listing_recordings/test_session_recording_list_from_query.pyindex 3129917b1a22..1c2585439721 100644--- a/posthog/session_recordings/queries/test/listing_recordings/test_session_recording_list_from_query.py+++ b/posthog/session_recordings/queries/test/listing_recordings/test_session_recording_list_from_query.py@@ -36,6 +36,7 @@ from posthog.hogql.printer import prepare_and_print_astfrom posthog.clickhouse.client import sync_executefrom posthog.clickhouse.log_entries import TRUNCATE_LOG_ENTRIES_TABLE_SQL+from posthog.clickhouse.query_tagging import tags_contextfrom posthog.models.group.util import create_groupfrom posthog.models.team import Teamfrom posthog.models.utils import uuid7@@ -874,6 +875,69 @@ class TestSessionRecordingsListFromQuery(ClickhouseTestMixin, APIBaseTest):assert len(queries) == 1assert queries[0].order_by is None+ @parameterized.expand(+ [+ ("enabled", True, {}, {}, True, "combined", True),+ ("disabled", False, {}, {}, True, "separate", True),+ ("unavailable", None, {}, {}, True, "separate", True),+ ("negative_property", True, {"category_operator": "is_not"}, {}, True, "separate", False),+ ("person_property", True, {"person_property": True}, {}, True, "separate", False),+ ("sampled", True, {}, {"sample_factor": 0.5}, True, "separate", False),+ (+ "timestamp_floor",+ True,+ {},+ {"events_timestamp_floor": datetime(2026, 1, 1, tzinfo=UTC)},+ True,+ "separate",+ False,+ ),+ ("other_caller", True, {}, {}, False, "separate", False),+ ]+ )+ def test_combined_event_filters_release_gate(+ self,+ _name: str,+ flag: bool | None,+ shape: dict[str, Any],+ builder_kwargs: dict[str, Any],+ opt_in: bool,+ expected_strategy: str,+ expected_eligible: bool,+ ) -> None:+ query: dict[str, Any] = {+ "events": [+ {+ "id": "view_item",+ "type": "events",+ "order": 0,+ "properties": [+ {+ "type": "event",+ "key": "category",+ "operator": shape.get("category_operator", "exact"),+ "value": "book",+ }+ ],+ },+ {"id": "add_item", "type": "events", "order": 1},+ ],+ }+ if shape.get("person_property"):+ query["properties"] = [{"type": "person", "key": "email", "operator": "exact", "value": "[email protected]"}]+ builder = ReplayFiltersEventsSubQuery(+ team=self.team, query=RecordingsQuery.model_validate(query), **builder_kwargs+ )+ with patch("posthoganalytics.get_feature_flag", return_value=flag) as evaluate:+ plan = builder.get_session_id_match_plan(allow_combined_filters=opt_in)+ assert (plan.strategy, plan.combined_eligible) == (expected_strategy, expected_eligible)+ if expected_strategy == "combined":+ assert len(plan.queries) == 1+ if expected_eligible:+ assert evaluate.call_args.args[0] == "replay-combined-event-filters"+ else:+ evaluate.assert_not_called()+@parameterized.expand([("events without a type", "events", None, EventsNode, "event_entities"),@@ -2870,6 +2934,95 @@ class TestSessionRecordingsListFromQuery(ClickhouseTestMixin, APIBaseTest):[],)+ @parameterized.expand(+ [+ ("AND", False, [0, 1, 2, 3]),+ ("AND", True, [0, 1, 2]),+ ("OR", False, [0, 1, 2, 3]),+ ("OR", True, [0, 1, 2, 3, 4]),+ ]+ )+ def test_combined_event_filters_preserve_results_and_cursors(+ self, operand: str, with_properties: bool, expected_indexes: list[int]+ ) -> None:+ sessions = [str(uuid7()) for _ in range(5)]+ for index, session_id in enumerate(sessions):+ start = self.an_hour_ago + relativedelta(minutes=index)+ produce_replay_summary(+ team_id=self.team.pk,+ distinct_id="combined-filter-user",+ session_id=session_id,+ first_timestamp=start,+ last_timestamp=start + relativedelta(minutes=5),+ ensure_analytics_event_in_session=False,+ )+ for name, offset, properties in [+ ("view_item", -30, {"category": "book" if index != 3 else "other"}),+ ("add_item", 600 if index == 2 else 60, {}),+ ("other_event", 120, {"category": "book", "source": "search"}),+ ]:+ if index == 4 and name != "other_event":+ continue+ create_event(+ team=self.team,+ distinct_id="combined-filter-user",+ timestamp=start + relativedelta(seconds=offset),+ event_name=name,+ properties={"$session_id": session_id, **properties},+ )+ filters: dict[str, Any] = {+ "operand": operand,+ "events": [+ {+ "id": "view_item",+ "type": "events",+ "order": 0,+ "properties": [{"type": "event", "key": "category", "operator": "exact", "value": "book"}],+ },+ {"id": "add_item", "type": "events", "order": 1},+ ],+ "properties": [{"type": "event", "key": "source", "operator": "exact", "value": "search"}],+ "limit": 2,+ "order": "start_time",+ "order_direction": "DESC",+ }+ if not with_properties:+ filters["events"][0].pop("properties")+ filters.pop("properties")+ pages_by_strategy: list[list[SessionRecordingQueryResult]] = []+ for enabled in [False, True]:+ pages: list[SessionRecordingQueryResult] = []+ after = None+ with (+ patch("posthoganalytics.get_feature_flag", return_value=enabled),+ patch(+ "posthog.session_recordings.queries.session_recording_list_from_query.tags_context",+ wraps=tags_context,+ ) as tags,+ ):+ for _ in range(len(sessions) + 1):+ page = filter_recordings_by(+ team=self.team, recordings_filter={**filters, "after": after}, allow_combined_event_filters=True+ )+ pages.append(page._replace(timings=None))+ if not page.has_more_recording:+ break+ after = page.next_cursor+ assert after is not None+ assert not pages[-1].has_more_recording+ assert any(+ call.kwargs.get("replay_event_query_strategy") == ("combined" if enabled else "separate")+ and call.kwargs.get("replay_event_filter_count") == (3 if with_properties else 2)+ and call.kwargs.get("replay_event_query_property_filter_count") == (2 if with_properties else 0)+ and call.kwargs.get("replay_combined_event_query_eligible") is True+ and call.kwargs.get("replay_event_query_operand") == operand+ for call in tags.call_args_list+ )+ pages_by_strategy.append(pages)+ assert pages_by_strategy[0] == pages_by_strategy[1]+ expected = [sessions[index] for index in reversed(expected_indexes)]+ assert [row["session_id"] for page in pages_by_strategy[1] for row in page.results] == expected+@also_test_with_materialized_columns(event_properties=["$current_url", "$browser"], person_properties=["email"])@snapshot_clickhouse_queriesdef test_event_filter_with_hogql_properties(self):diff --git a/posthog/session_recordings/queries/test/listing_recordings/test_utils.py b/posthog/session_recordings/queries/test/listing_recordings/test_utils.pyindex 0cdb397038d9..90fc8ee58a7c 100644--- a/posthog/session_recordings/queries/test/listing_recordings/test_utils.py+++ b/posthog/session_recordings/queries/test/listing_recordings/test_utils.py@@ -35,6 +35,7 @@ def filter_recordings_by(recordings_filter: dict | None = None,allow_event_property_expansion: bool = False,user: User | None = None,+ allow_combined_event_filters: bool = False,) -> SessionRecordingQueryResult:the_query = RecordingsQuery.model_validate(query_as_params_to_dict(recordings_filter or {}))session_recording_list_instance = SessionRecordingListFromQuery(@@ -43,6 +44,7 @@ def filter_recordings_by(hogql_query_modifiers=None,allow_event_property_expansion=allow_event_property_expansion,user=user,+ allow_combined_event_filters=allow_combined_event_filters,)return session_recording_list_instance.run()diff --git a/posthog/session_recordings/session_recording_api.py b/posthog/session_recordings/session_recording_api.pyindex 8eb6bf4d88db..0e68c3fa38e8 100644--- a/posthog/session_recordings/session_recording_api.py+++ b/posthog/session_recordings/session_recording_api.py@@ -928,6 +928,7 @@ class SessionRecordingViewSet(# show explicitly selected sessions (e.g. a funnel drop-off handoff)# even outside the date rangebypass_date_window_for_session_ids=True,+ allow_combined_event_filters=True,)with tracer.start_as_current_span("make_response"):@@ -1801,6 +1802,7 @@ def list_recordings_from_query(team: Team,allow_event_property_expansion: bool = False,bypass_date_window_for_session_ids: bool = False,+ allow_combined_event_filters: bool = False,) -> RecordingsListingResult:"""Loads the listing from ClickHouse, then overlays any Postgres row (pins, shares) onto each result.@@ -1862,6 +1864,7 @@ def list_recordings_from_query(allow_event_property_expansion=allow_event_property_expansion,session_ids_to_exclude=session_ids_to_exclude,bypass_date_window_for_session_ids=bypass_date_window_for_session_ids,+ allow_combined_event_filters=allow_combined_event_filters,).run()ch_session_recordings = query_result.results