From 7c89fd65ccd7b0c34d5b47734f3f626c072a9486 Mon Sep 17 00:00:00 2001 From: Robbie Coomber Date: Mon, 16 Oct 2023 12:28:17 +0100 Subject: [PATCH] Fix typing issues --- .../web_analytics/web_analytics_query_runner.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 01e778f1b7c67..8a9d1e0b72d9b 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) + for p in self.query.properties: + if isinstance(p, EventPropertyFilter) and p.key == "$pathname": + return p + return 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):