From 30babc39a8e7023bc335a5d8748135066cd08c7d 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 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):