Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions products/cohorts/backend/models/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from rest_framework.exceptions import ValidationError

from posthog.hogql import ast
from posthog.hogql.constants import HogQLGlobalSettings, LimitContext
from posthog.hogql.constants import HogQLGlobalSettings, LimitContext, get_default_hogql_global_settings
from posthog.hogql.hogql import HogQLContext
from posthog.hogql.modifiers import create_default_modifiers_for_team
from posthog.hogql.parser import parse_select
Expand Down Expand Up @@ -843,7 +843,7 @@ def execute_query():
cohort_id=cohort.pk,
team_id=team.id,
)
hogql_global_settings = HogQLGlobalSettings()
hogql_global_settings = get_default_hogql_global_settings(team_id=team.id)

return sync_execute(
recalculate_cohortpeople_sql,
Expand All @@ -854,12 +854,11 @@ def execute_query():
"new_version": pending_version,
},
settings={
**hogql_global_settings.model_dump(exclude_none=True),
"max_execution_time": COHORT_QUERY_TIMEOUT_SECONDS,
"send_timeout": COHORT_QUERY_TIMEOUT_SECONDS,
"receive_timeout": COHORT_QUERY_TIMEOUT_SECONDS,
"optimize_on_insert": 0,
"max_ast_elements": hogql_global_settings.max_ast_elements,
"max_expanded_ast_elements": hogql_global_settings.max_expanded_ast_elements,
"max_bytes_ratio_before_external_group_by": 0.5,
"max_bytes_ratio_before_external_sort": 0.5,
},
Expand Down
Loading