Skip to content

Commit

Permalink
fix(data-warehouse): Fix long running materialized views (#26548)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilbert09 authored Nov 29, 2024
1 parent 3355543 commit c59db26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion posthog/temporal/data_modeling/run_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit c59db26

Please sign in to comment.