diff --git a/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py b/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py index 01e778f1b7c67b..0dbb7a9d144029 100644 --- a/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py +++ b/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py @@ -13,6 +13,7 @@ WebTopClicksQuery, WebOverviewStatsQuery, WebStatsTableQuery, + HogQLPropertyFilter, ) WebQueryNode = Union[ @@ -38,10 +39,13 @@ def query_date_range(self): @cached_property def pathname_property_filter(self) -> Optional[EventPropertyFilter]: - return next((p for p in self.query.properties if p.key == "$pathname"), None) + return next( + (p for p in self.query.properties if isinstance(p, EventPropertyFilter) and p.type == p.key == "$pathname"), + None, + ) @cached_property - def property_filters_without_pathname(self) -> List[EventPropertyFilter]: + def property_filters_without_pathname(self) -> List[Union[EventPropertyFilter, HogQLPropertyFilter]]: return [p for p in self.query.properties if p.key != "$pathname"] def session_where(self):