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 5c97e3ce6f78c..5d848a5057c57 100644 --- a/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py +++ b/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py @@ -88,8 +88,9 @@ def _current_period_expression(self, field="start_timestamp"): ) def _previous_period_expression(self, field="start_timestamp"): + # NOTE: Returning `ast.Constant(value=None)` is painfully slow, make sure we return a boolean if not self.query_compare_to_date_range: - return ast.Constant(value=None) + return ast.Constant(value=False) return ast.Call( name="and",