From a8e5ce65d6d11918c0d6706f44ca62002519121e Mon Sep 17 00:00:00 2001 From: Rafa Audibert Date: Mon, 2 Dec 2024 18:36:02 -0300 Subject: [PATCH] Fix mypy errors --- mypy-baseline.txt | 1 - .../hogql_queries/web_analytics/web_analytics_query_runner.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/mypy-baseline.txt b/mypy-baseline.txt index c7017447c0f92..c10acc6d019e1 100644 --- a/mypy-baseline.txt +++ b/mypy-baseline.txt @@ -411,7 +411,6 @@ posthog/api/survey.py:0: error: Incompatible types in assignment (expression has posthog/api/survey.py:0: error: Item "list[_ErrorFullDetails]" of "_FullDetailDict | list[_ErrorFullDetails] | dict[str, _ErrorFullDetails]" has no attribute "get" [union-attr] posthog/api/survey.py:0: error: Item "object" of "object | Any" has no attribute "__iter__" (not iterable) [union-attr] posthog/hogql_queries/web_analytics/web_overview.py:0: error: Module "django.utils.timezone" does not explicitly export attribute "datetime" [attr-defined] -posthog/hogql_queries/web_analytics/top_clicks.py:0: error: Module "django.utils.timezone" does not explicitly export attribute "datetime" [attr-defined] posthog/api/user.py:0: error: Module has no attribute "utc" [attr-defined] posthog/api/user.py:0: error: Module has no attribute "utc" [attr-defined] posthog/api/user.py:0: error: "User" has no attribute "social_auth" [attr-defined] 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 c542c6dd9cda7..ae743b6ccfd34 100644 --- a/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py +++ b/posthog/hogql_queries/web_analytics/web_analytics_query_runner.py @@ -85,7 +85,7 @@ def period_aggregate(self, function_name, column_name, start, end, alias=None, p expr = ast.Call(name=function_name, params=params, args=[ast.Field(chain=[column_name])]) if alias is not None: - expr = ast.Alias(alias=alias, expr=expr) + return ast.Alias(alias=alias, expr=expr) return expr