From c59db26158871ca49258789aed7f67193b34dcba Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Fri, 29 Nov 2024 14:23:51 +0000 Subject: [PATCH] fix(data-warehouse): Fix long running materialized views (#26548) --- posthog/temporal/data_modeling/run_workflow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posthog/temporal/data_modeling/run_workflow.py b/posthog/temporal/data_modeling/run_workflow.py index db65fc638f706..f6f35bb9a67b3 100644 --- a/posthog/temporal/data_modeling/run_workflow.py +++ b/posthog/temporal/data_modeling/run_workflow.py @@ -23,6 +23,7 @@ from django.conf import settings from dlt.common.libs.deltalake import get_delta_tables +from posthog.hogql.constants import HogQLGlobalSettings from posthog.hogql.database.database import create_hogql_database from posthog.hogql.query import execute_hogql_query from posthog.models import Team @@ -344,7 +345,9 @@ def hogql_table(query: str, team: Team, table_name: str, table_columns: dlt_typi """A dlt source representing a HogQL table given by a HogQL query.""" async def get_hogql_rows(): - response = await asyncio.to_thread(execute_hogql_query, query, team) + settings = HogQLGlobalSettings(max_execution_time=60 * 10) # 10 mins, same as the /query endpoint async workers + + response = await asyncio.to_thread(execute_hogql_query, query, team, settings=settings) if not response.columns: raise EmptyHogQLResponseColumnsError()