From b09e3f00b4a1b2d5f5defc5ae34a845b6730ce69 Mon Sep 17 00:00:00 2001 From: Rafael Audibert <32079912+rafaeelaudibert@users.noreply.github.com> Date: Thu, 26 Dec 2024 13:42:04 -0300 Subject: [PATCH] fix: Ignore viewports where width/height is 0 (#27160) --- posthog/hogql_queries/web_analytics/stats_table.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/posthog/hogql_queries/web_analytics/stats_table.py b/posthog/hogql_queries/web_analytics/stats_table.py index 862d2830c9fba..8b5ff36f76df3 100644 --- a/posthog/hogql_queries/web_analytics/stats_table.py +++ b/posthog/hogql_queries/web_analytics/stats_table.py @@ -564,7 +564,8 @@ def where_breakdown(self): return parse_expr("tupleElement(breakdown_value, 2) IS NOT NULL") case WebStatsBreakdown.VIEWPORT: return parse_expr( - "tupleElement(breakdown_value, 1) IS NOT NULL AND tupleElement(breakdown_value, 2) IS NOT NULL" + "tupleElement(breakdown_value, 1) IS NOT NULL AND tupleElement(breakdown_value, 2) IS NOT NULL AND " + "tupleElement(breakdown_value, 1) != 0 AND tupleElement(breakdown_value, 2) != 0" ) case ( WebStatsBreakdown.INITIAL_UTM_SOURCE