:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(hogql-queries): promote shared machinery out of insights/ (#92222)
Thomas Obermüller897c502836f8
diff --git a/ee/hogai/context/insight/format/trends.py b/ee/hogai/context/insight/format/trends.pyindex a72a4785027c..b5ee233845bf 100644--- a/ee/hogai/context/insight/format/trends.py+++ b/ee/hogai/context/insight/format/trends.py@@ -3,7 +3,7 @@ from typing import Any, Optionalfrom posthog.schema import AssistantTrendsQuery, Compare, DateRange, TrendsQuery-from posthog.hogql_queries.insights.utils.breakdowns import humanize_breakdown_label+from posthog.hogql_queries.utils.breakdowns import humanize_breakdown_labelfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.models import Teamdiff --git a/ee/surveys/summaries/headline_summary.py b/ee/surveys/summaries/headline_summary.pyindex 532cfc204051..1103459ea2ba 100644--- a/ee/surveys/summaries/headline_summary.py+++ b/ee/surveys/summaries/headline_summary.py@@ -10,7 +10,7 @@ from posthog.hogql import astfrom posthog.hogql.parser import parse_selectfrom posthog.api.utils import ServerTimingsGathered-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models import Team, Userfrom products.surveys.backend.models import Surveydiff --git a/ee/surveys/summaries/summarize_surveys.py b/ee/surveys/summaries/summarize_surveys.pyindex bf2c846ae9fe..597b5a54d933 100644--- a/ee/surveys/summaries/summarize_surveys.py+++ b/ee/surveys/summaries/summarize_surveys.py@@ -10,7 +10,7 @@ from posthog.hogql import astfrom posthog.hogql.parser import parse_selectfrom posthog.api.utils import ServerTimingsGathered-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models import Team, Userfrom posthog.utils import get_instance_regiondiff --git a/frontend/src/scenes/insights/utils.tsx b/frontend/src/scenes/insights/utils.tsxindex b2b1a8ac10a9..e8cd50c6c5e9 100644--- a/frontend/src/scenes/insights/utils.tsx+++ b/frontend/src/scenes/insights/utils.tsx@@ -252,7 +252,7 @@ export function formatAggregationValue(return Array.isArray(formattedValue) ? formattedValue[0] : formattedValue}-// NB! Sync this with breakdown_values.py and hogql_queries/insights/utils/breakdowns.py+// NB! Sync this with breakdown_values.py and hogql_queries/utils/breakdowns.pyexport const BREAKDOWN_OTHER_STRING_LABEL = '$$_posthog_breakdown_other_$$'export const BREAKDOWN_OTHER_NUMERIC_LABEL = 9007199254740991 // pow(2, 53) - 1export const BREAKDOWN_OTHER_DISPLAY = 'Other (i.e. all remaining values)'@@ -327,7 +327,7 @@ function formatNumericBreakdownLabel(return String(breakdown_value)}-// Keep in sync with NOT_IN_COHORT_ID in posthog/hogql_queries/insights/utils/breakdowns.py+// Keep in sync with NOT_IN_COHORT_ID in posthog/hogql_queries/utils/breakdowns.pyexport const NOT_IN_COHORT_ID = 2 ** 52export function getCohortNameFromId(diff --git a/posthog/hogql_queries/actor_strategies.py b/posthog/hogql_queries/actor_strategies.pyindex d36a93f84b14..cffc496bb8f5 100644--- a/posthog/hogql_queries/actor_strategies.py+++ b/posthog/hogql_queries/actor_strategies.py@@ -12,7 +12,7 @@ from posthog.hogql.parser import parse_expr, parse_selectfrom posthog.hogql.property import property_to_exprfrom posthog.hogql.query import execute_hogql_query-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.utils.recordings_helper import RecordingsHelperfrom posthog.models import Teamfrom posthog.models.person.util import _batched_get_distinct_ids_for_persons, _batched_get_persons_by_uuidsdiff --git a/posthog/hogql_queries/actors_query_runner.py b/posthog/hogql_queries/actors_query_runner.pyindex 5b5a26c302f4..6edc4385df00 100644--- a/posthog/hogql_queries/actors_query_runner.py+++ b/posthog/hogql_queries/actors_query_runner.py@@ -26,8 +26,8 @@ from posthog.hogql.resolver_utils import extract_select_queriesfrom posthog.api.person import PERSON_DEFAULT_DISPLAY_NAME_PROPERTIESfrom posthog.clickhouse.query_tagging import tag_contains_user_hogqlfrom posthog.hogql_queries.actor_strategies import ActorStrategy, GroupStrategy, PersonStrategy, SessionStrategy-from posthog.hogql_queries.insights.insight_actors_query_runner import InsightActorsQueryRunner-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.insight_actors_query_runner import InsightActorsQueryRunner+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunner, ExecutionMode, QueryRunner, get_query_runnerfrom posthog.hogql_queries.utils.person_display_name import person_display_name_property_exprsfrom posthog.models import Userdiff --git a/posthog/hogql_queries/ai/event_taxonomy_query_runner.py b/posthog/hogql_queries/ai/event_taxonomy_query_runner.pyindex 33d2d86208c9..840a15896ae3 100644--- a/posthog/hogql_queries/ai/event_taxonomy_query_runner.py+++ b/posthog/hogql_queries/ai/event_taxonomy_query_runner.py@@ -14,7 +14,7 @@ from posthog.hogql.property import action_to_exprfrom posthog.clickhouse.query_tagging import Product, tags_contextfrom posthog.hogql_queries.ai.utils import TaxonomyCacheMixin-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.models.event.new_events_schema import use_new_events_schemadiff --git a/posthog/hogql_queries/ai/session_batch_events_query_runner.py b/posthog/hogql_queries/ai/session_batch_events_query_runner.pyindex fa0204d59988..503520145b6e 100644--- a/posthog/hogql_queries/ai/session_batch_events_query_runner.py+++ b/posthog/hogql_queries/ai/session_batch_events_query_runner.py@@ -10,7 +10,7 @@ from posthog.schema import (from posthog.clickhouse.query_tagging import Product, tags_contextfrom posthog.hogql_queries.events_query_runner import EventsQueryRunner-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import QueryRunnerfrom posthog.session_recordings.constants import (DEFAULT_TOTAL_EVENTS_PER_QUERY,diff --git a/posthog/hogql_queries/ai/session_query_runner.py b/posthog/hogql_queries/ai/session_query_runner.pyindex 314a90e728e4..9a5f8da620d4 100644--- a/posthog/hogql_queries/ai/session_query_runner.py+++ b/posthog/hogql_queries/ai/session_query_runner.py@@ -30,7 +30,7 @@ from posthog.hogql_queries.ai.sentiment_evaluations import (load_generation_sentiment_evaluations_for_traces,)from posthog.hogql_queries.ai.utils import merge_heavy_properties-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.models.event.new_events_schema import use_new_events_schemadiff --git a/posthog/hogql_queries/ai/team_taxonomy_query_runner.py b/posthog/hogql_queries/ai/team_taxonomy_query_runner.pyindex 1f1e94f591b6..c25e391936a2 100644--- a/posthog/hogql_queries/ai/team_taxonomy_query_runner.py+++ b/posthog/hogql_queries/ai/team_taxonomy_query_runner.py@@ -11,7 +11,7 @@ from posthog.hogql.parser import parse_selectfrom posthog.clickhouse.query_tagging import Product, tags_contextfrom posthog.hogql_queries.ai.utils import TaxonomyCacheMixin-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnertry:diff --git a/posthog/hogql_queries/ai/traces_query_runner.py b/posthog/hogql_queries/ai/traces_query_runner.pyindex 05109f66288f..e4ec6f3f0061 100644--- a/posthog/hogql_queries/ai/traces_query_runner.py+++ b/posthog/hogql_queries/ai/traces_query_runner.py@@ -32,7 +32,7 @@ from posthog.hogql_queries.ai.sentiment_evaluations import (load_trace_sentiment_evaluations,)from posthog.hogql_queries.ai.utils import filled_property_filters, parse_ai_properties, parse_ai_property_value-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangediff --git a/posthog/hogql_queries/insights/data_warehouse_mixin.py b/posthog/hogql_queries/data_warehouse_mixin.pysimilarity index 100%rename from posthog/hogql_queries/insights/data_warehouse_mixin.pyrename to posthog/hogql_queries/data_warehouse_mixin.pydiff --git a/posthog/hogql_queries/document_embeddings_query_runner.py b/posthog/hogql_queries/document_embeddings_query_runner.pyindex 4f15c2aa60d1..2a7968fe35f6 100644--- a/posthog/hogql_queries/document_embeddings_query_runner.py+++ b/posthog/hogql_queries/document_embeddings_query_runner.py@@ -15,7 +15,7 @@ from posthog.schema import (from posthog.hogql import astfrom posthog.hogql.constants import LimitContext-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.utils import relative_date_parsediff --git a/posthog/hogql_queries/events_query_runner.py b/posthog/hogql_queries/events_query_runner.pyindex 71fca871e62b..920d714cea25 100644--- a/posthog/hogql_queries/events_query_runner.py+++ b/posthog/hogql_queries/events_query_runner.py@@ -25,8 +25,8 @@ from posthog.hogql.query import execute_hogql_queryfrom posthog.api.element import ElementSerializerfrom posthog.api.person import PERSON_DEFAULT_DISPLAY_NAME_PROPERTIESfrom posthog.clickhouse.query_tagging import tag_contains_user_hogql-from posthog.hogql_queries.insights.insight_actors_query_runner import InsightActorsQueryRunner-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.insight_actors_query_runner import InsightActorsQueryRunner+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunner, get_query_runnerfrom posthog.hogql_queries.utils.person_display_name import person_display_name_property_exprsfrom posthog.models import Person, PropertyDefinitiondiff --git a/posthog/hogql_queries/groups/groups_query_runner.py b/posthog/hogql_queries/groups/groups_query_runner.pyindex a1e12ccdc017..397e347224b5 100644--- a/posthog/hogql_queries/groups/groups_query_runner.py+++ b/posthog/hogql_queries/groups/groups_query_runner.py@@ -4,7 +4,7 @@ from posthog.hogql import astfrom posthog.hogql.parser import parse_expr, parse_order_exprfrom posthog.hogql.property import has_aggregation, property_to_expr-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerdiff --git a/posthog/hogql_queries/hogql_query_runner.py b/posthog/hogql_queries/hogql_query_runner.pyindex c510e475a2fc..13fde0aa93d2 100644--- a/posthog/hogql_queries/hogql_query_runner.py+++ b/posthog/hogql_queries/hogql_query_runner.py@@ -31,7 +31,7 @@ from posthog import settings as app_settingsfrom posthog.caching.utils import ThresholdMode, staleness_threshold_mapfrom posthog.clickhouse.query_tagging import tag_contains_user_hogqlfrom posthog.event_usage import AnalyticsProps-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunner, ExecutionModefrom posthog.models import Userfrom posthog.models.activity_logging.retention import get_activity_log_lookback_restrictiondiff --git a/posthog/hogql_queries/insights/insight_actors_query_options_runner.py b/posthog/hogql_queries/insight_actors_query_options_runner.pysimilarity index 100%rename from posthog/hogql_queries/insights/insight_actors_query_options_runner.pyrename to posthog/hogql_queries/insight_actors_query_options_runner.pydiff --git a/posthog/hogql_queries/insights/insight_actors_query_runner.py b/posthog/hogql_queries/insight_actors_query_runner.pysimilarity index 100%rename from posthog/hogql_queries/insights/insight_actors_query_runner.pyrename to posthog/hogql_queries/insight_actors_query_runner.pydiff --git a/posthog/hogql_queries/insights/test/__init__.py b/posthog/hogql_queries/insights/test/__init__.pydeleted file mode 100644index e69de29bb2d1..000000000000diff --git a/posthog/hogql_queries/insights/trends/aggregation_operations.py b/posthog/hogql_queries/insights/trends/aggregation_operations.pyindex 9e491cd2adde..7abb60bfee0b 100644--- a/posthog/hogql_queries/insights/trends/aggregation_operations.py+++ b/posthog/hogql_queries/insights/trends/aggregation_operations.py@@ -19,9 +19,9 @@ from posthog.hogql.placeholders import replace_placeholdersfrom posthog.clickhouse.query_tagging import tag_contains_user_hogqlfrom posthog.constants import NON_TIME_SERIES_DISPLAY_TYPES-from posthog.hogql_queries.insights.data_warehouse_mixin import DataWarehouseInsightQueryMixin+from posthog.hogql_queries.data_warehouse_mixin import DataWarehouseInsightQueryMixinfrom posthog.hogql_queries.insights.trends.utils import is_groups_math-from posthog.hogql_queries.insights.utils.aggregations import FirstTimeForUserEventsQueryAlternator, QueryAlternator+from posthog.hogql_queries.utils.aggregations import FirstTimeForUserEventsQueryAlternator, QueryAlternatorfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.models.team.team import Teamdiff --git a/posthog/hogql_queries/insights/trends/boxplot_trends_query_runner.py b/posthog/hogql_queries/insights/trends/boxplot_trends_query_runner.pyindex ce97e2dc7a0f..420522eeb87e 100644--- a/posthog/hogql_queries/insights/trends/boxplot_trends_query_runner.py+++ b/posthog/hogql_queries/insights/trends/boxplot_trends_query_runner.py@@ -14,8 +14,8 @@ from posthog.clickhouse.query_tagging import Feature, Product, tags_contextfrom posthog.hogql_queries.insights.trends.aggregation_operations import AggregationOperationsfrom posthog.hogql_queries.insights.trends.trends_query_builder import TrendsQueryBuilderfrom posthog.hogql_queries.insights.trends.trends_query_runner import TrendsQueryRunner-from posthog.hogql_queries.insights.utils.utils import get_response_hogqlfrom posthog.hogql_queries.utils.timestamp_utils import format_label_date+from posthog.hogql_queries.utils.utils import get_response_hogqlclass BoxPlotTrendsQueryRunner(TrendsQueryRunner):diff --git a/posthog/hogql_queries/insights/trends/breakdown.py b/posthog/hogql_queries/insights/trends/breakdown.pyindex a91f394803f5..29d083c6379f 100644--- a/posthog/hogql_queries/insights/trends/breakdown.py+++ b/posthog/hogql_queries/insights/trends/breakdown.py@@ -24,7 +24,7 @@ from posthog.hogql.timings import HogQLTimingsfrom posthog.clickhouse.query_tagging import tag_contains_user_hogqlfrom posthog.hogql_queries.insights.trends.display import TrendsDisplayfrom posthog.hogql_queries.insights.trends.utils import get_properties_chain-from posthog.hogql_queries.insights.utils.breakdowns import (+from posthog.hogql_queries.utils.breakdowns import (BREAKDOWN_NULL_STRING_LABEL,BREAKDOWN_NUMERIC_ALL_VALUES_PLACEHOLDER,BREAKDOWN_OTHER_STRING_LABEL,diff --git a/posthog/hogql_queries/insights/trends/test/test_trends_breakdown_empty_null_properties.py b/posthog/hogql_queries/insights/trends/test/test_trends_breakdown_empty_null_properties.pyindex 357be48f3dc4..85f32310e0ec 100644--- a/posthog/hogql_queries/insights/trends/test/test_trends_breakdown_empty_null_properties.py+++ b/posthog/hogql_queries/insights/trends/test/test_trends_breakdown_empty_null_properties.py@@ -25,7 +25,7 @@ from posthog.schema import (from posthog.hogql_queries.actors_query_runner import ActorsQueryRunnerfrom posthog.hogql_queries.insights.trends.trends_query_runner import TrendsQueryRunner-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL@override_settings(IN_UNIT_TESTING=True)diff --git a/posthog/hogql_queries/insights/trends/test/test_trends_persons.py b/posthog/hogql_queries/insights/trends/test/test_trends_persons.pyindex e81fd987a7cc..d80bda1c1f19 100644--- a/posthog/hogql_queries/insights/trends/test/test_trends_persons.py+++ b/posthog/hogql_queries/insights/trends/test/test_trends_persons.py@@ -36,7 +36,7 @@ from posthog.schema import (from posthog.api.test.test_team import create_teamfrom posthog.hogql_queries.actors_query_runner import ActorsQueryRunner-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABELfrom posthog.models import Teamfrom posthog.models.group.util import create_groupfrom posthog.test.test_utils import create_group_type_mapping_without_created_atdiff --git a/posthog/hogql_queries/insights/trends/test/test_trends_query_runner.py b/posthog/hogql_queries/insights/trends/test/test_trends_query_runner.pyindex c423f0f825fe..4c17544a8fc0 100644--- a/posthog/hogql_queries/insights/trends/test/test_trends_query_runner.py+++ b/posthog/hogql_queries/insights/trends/test/test_trends_query_runner.py@@ -67,7 +67,7 @@ from posthog.hogql.query import execute_hogql_queryfrom posthog.clickhouse.client.execute import sync_executefrom posthog.hogql_queries.insights.trends.trends_query_runner import TrendsQueryRunner-from posthog.hogql_queries.insights.utils.breakdowns import (+from posthog.hogql_queries.utils.breakdowns import (BREAKDOWN_NULL_DISPLAY,BREAKDOWN_NULL_STRING_LABEL,BREAKDOWN_OTHER_DISPLAY,diff --git a/posthog/hogql_queries/insights/trends/trend_validation_rules.py b/posthog/hogql_queries/insights/trends/trend_validation_rules.pyindex 3e84a3a103bf..3544559600ce 100644--- a/posthog/hogql_queries/insights/trends/trend_validation_rules.py+++ b/posthog/hogql_queries/insights/trends/trend_validation_rules.py@@ -3,12 +3,8 @@ from rest_framework.exceptions import ValidationErrorfrom posthog.schema import BreakdownType, MultipleBreakdownType, PropertyMathType, TrendsQueryfrom posthog.hogql_queries.insights.trends.aggregation_operations import SUPPORTED_PROPERTY_MATH_FOR_HISTOGRAM_BREAKDOWN-from posthog.hogql_queries.insights.utils.breakdowns import (- has_breakdown_filter,- has_multi_breakdown,- has_single_breakdown,-)-from posthog.hogql_queries.insights.utils.entities import has_data_warehouse_node+from posthog.hogql_queries.utils.breakdowns import has_breakdown_filter, has_multi_breakdown, has_single_breakdown+from posthog.hogql_queries.utils.entities import has_data_warehouse_nodefrom posthog.hogql_queries.validation.utils import get_query_insight_namefrom posthog.hogql_queries.validation.validation import QueryValidationContextdiff --git a/posthog/hogql_queries/insights/trends/trends_query_builder.py b/posthog/hogql_queries/insights/trends/trends_query_builder.pyindex 9c27ad1c4ed6..74e4956fe59c 100644--- a/posthog/hogql_queries/insights/trends/trends_query_builder.py+++ b/posthog/hogql_queries/insights/trends/trends_query_builder.py@@ -17,12 +17,12 @@ from posthog.hogql.parser import parse_expr, parse_selectfrom posthog.hogql.property import action_to_expr, property_to_exprfrom posthog.hogql.timings import HogQLTimings-from posthog.hogql_queries.insights.data_warehouse_mixin import DataWarehouseInsightQueryMixin+from posthog.hogql_queries.data_warehouse_mixin import DataWarehouseInsightQueryMixinfrom posthog.hogql_queries.insights.trends.aggregation_operations import AggregationOperationsfrom posthog.hogql_queries.insights.trends.breakdown import Breakdownfrom posthog.hogql_queries.insights.trends.display import TrendsDisplayfrom posthog.hogql_queries.insights.trends.utils import group_node_to_expr, is_groups_math-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABELfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.models.filters.mixins.utils import cached_propertyfrom posthog.models.team.team import Teamdiff --git a/posthog/hogql_queries/insights/trends/trends_query_runner.py b/posthog/hogql_queries/insights/trends/trends_query_runner.pyindex 9bf35d923f47..cffa11af75bd 100644--- a/posthog/hogql_queries/insights/trends/trends_query_runner.py+++ b/posthog/hogql_queries/insights/trends/trends_query_runner.py@@ -64,7 +64,8 @@ from posthog.hogql_queries.insights.trends.trend_validation_rules import ()from posthog.hogql_queries.insights.trends.trends_actors_query_builder import TrendsActorsQueryBuilderfrom posthog.hogql_queries.insights.trends.trends_query_builder import TrendsQueryBuilder-from posthog.hogql_queries.insights.utils.breakdowns import (+from posthog.hogql_queries.query_runner import AnalyticsQueryRunner, resolve_series_custom_name+from posthog.hogql_queries.utils.breakdowns import (BREAKDOWN_NULL_DISPLAY,BREAKDOWN_NULL_STRING_LABEL,BREAKDOWN_NUMERIC_ALL_VALUES_PLACEHOLDER,@@ -72,13 +73,12 @@ from posthog.hogql_queries.insights.utils.breakdowns import (BREAKDOWN_OTHER_STRING_LABEL,has_breakdown_filter,)-from posthog.hogql_queries.insights.utils.utils import get_response_hogql-from posthog.hogql_queries.query_runner import AnalyticsQueryRunner, resolve_series_custom_namefrom posthog.hogql_queries.utils.formula_ast import FormulaASTfrom posthog.hogql_queries.utils.query_compare_to_date_range import QueryCompareToDateRangefrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.hogql_queries.utils.query_previous_period_date_range import QueryPreviousPeriodDateRangefrom posthog.hogql_queries.utils.timestamp_utils import format_label_date, get_earliest_timestamp_from_series+from posthog.hogql_queries.utils.utils import get_response_hogqlfrom posthog.hogql_queries.validation.rules import DisallowUnsupportedDataWarehouseSettings, RequireAtLeastOneSeriesfrom posthog.hogql_queries.validation.validation import QueryValidationRulefrom posthog.models import Team@@ -108,7 +108,7 @@ class TrendsQueryRunner(AnalyticsQueryRunner[TrendsQueryResponse]):limit_context: Optional[LimitContext] = None,user: Optional[User] = None,):- from posthog.hogql_queries.insights.utils.utils import convert_active_user_math_based_on_interval+ from posthog.hogql_queries.utils.utils import convert_active_user_math_based_on_intervalif isinstance(query, dict):query = TrendsQuery.model_validate(query)diff --git a/posthog/hogql_queries/insights/utils/__init__.py b/posthog/hogql_queries/insights/utils/__init__.pydeleted file mode 100644index e69de29bb2d1..000000000000diff --git a/posthog/hogql_queries/insights/utils/test/__init__.py b/posthog/hogql_queries/insights/utils/test/__init__.pydeleted file mode 100644index e69de29bb2d1..000000000000diff --git a/posthog/hogql_queries/owners.yaml b/posthog/hogql_queries/owners.yamlindex a696a6d096b8..b3f38f2224f4 100644--- a/posthog/hogql_queries/owners.yaml+++ b/posthog/hogql_queries/owners.yaml@@ -5,6 +5,8 @@ rules:owners: team-product-analytics- match: '/ai/'owners: team-ai-observability+ - match: ['/data_warehouse_mixin.py', '/query_context.py', '/paginators.py']+ owners: team-product-analytics- match: '/document_embeddings_query_runner.py'owners: team-self-driving- match: '/endpoints/'@@ -15,7 +17,19 @@ rules:owners: team-feature-flags- match: '/hogql_query_runner.py'owners: team-data-tools+ - match: ['/insight_actors_query_runner.py', '/insight_actors_query_options_runner.py']+ owners: team-product-analytics- match: ['/insights/', '/property_values_query_runner.py']owners: team-product-analytics- match: ['/sessions_query_runner.py', '/sessions_timeline_query_runner.py']owners: team-analytics-platform+ - match:+ [+ '/utils/aggregations.py',+ '/utils/breakdowns.py',+ '/utils/data_warehouse_schema_mixin.py',+ '/utils/entities.py',+ '/utils/properties.py',+ '/utils/utils.py',+ ]+ owners: team-product-analyticsdiff --git a/posthog/hogql_queries/insights/paginators.py b/posthog/hogql_queries/paginators.pysimilarity index 100%rename from posthog/hogql_queries/insights/paginators.pyrename to posthog/hogql_queries/paginators.pydiff --git a/posthog/hogql_queries/insights/query_context.py b/posthog/hogql_queries/query_context.pysimilarity index 100%rename from posthog/hogql_queries/insights/query_context.pyrename to posthog/hogql_queries/query_context.pydiff --git a/posthog/hogql_queries/query_runner.py b/posthog/hogql_queries/query_runner.pyindex 99c718c62216..52dbb9747e87 100644--- a/posthog/hogql_queries/query_runner.py+++ b/posthog/hogql_queries/query_runner.py@@ -130,16 +130,16 @@ from posthog.event_usage import AnalyticsProps, groups, report_user_or_team_actifrom posthog.exceptions import APIQueriesQuotaExceededfrom posthog.exceptions_capture import capture_exceptionfrom posthog.hogql_queries.access_controlled_resources import queried_access_controlled_resources-from posthog.hogql_queries.insights.utils.breakdowns import has_multi_breakdown, has_single_breakdown-from posthog.hogql_queries.insights.utils.entities import has_data_warehouse_node-from posthog.hogql_queries.insights.utils.properties import has_any_property_filtersfrom posthog.hogql_queries.query_failure_handling import (budget_for_limit_context,build_failure_exception,classify_failure,)from posthog.hogql_queries.query_metadata import extract_query_metadata+from posthog.hogql_queries.utils.breakdowns import has_multi_breakdown, has_single_breakdown+from posthog.hogql_queries.utils.entities import has_data_warehouse_nodefrom posthog.hogql_queries.utils.event_usage import log_event_usage_from_query_metadata+from posthog.hogql_queries.utils.properties import has_any_property_filtersfrom posthog.hogql_queries.validation.validation import (QueryValidationContext,QueryValidationRule,@@ -755,7 +755,7 @@ def get_query_runner("StickinessActorsQuery","PathsV2ActorsQuery",):- from .insights.insight_actors_query_runner import InsightActorsQueryRunner+ from .insight_actors_query_runner import InsightActorsQueryRunnerreturn InsightActorsQueryRunner(query=cast(InsightActorsQuery | dict[str, Any], query),@@ -766,7 +766,7 @@ def get_query_runner(user=user,)if kind == "InsightActorsQueryOptions":- from .insights.insight_actors_query_options_runner import InsightActorsQueryOptionsRunner+ from .insight_actors_query_options_runner import InsightActorsQueryOptionsRunnerreturn InsightActorsQueryOptionsRunner(query=cast(InsightActorsQueryOptions | dict[str, Any], query),diff --git a/posthog/hogql_queries/sessions_query_runner.py b/posthog/hogql_queries/sessions_query_runner.pyindex 5f66d9c8e5f1..1a874ba482ac 100644--- a/posthog/hogql_queries/sessions_query_runner.py+++ b/posthog/hogql_queries/sessions_query_runner.py@@ -19,7 +19,7 @@ from posthog.hogql.property import action_to_expr, has_aggregation, map_virtual_from posthog.api.person import PERSON_DEFAULT_DISPLAY_NAME_PROPERTIESfrom posthog.clickhouse.query_tagging import tag_contains_user_hogql-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.hogql_queries.utils.person_display_name import person_display_name_property_exprsfrom posthog.models import Persondiff --git a/posthog/hogql_queries/insights/test/__snapshots__/test_insight_actors_query_runner.ambr b/posthog/hogql_queries/test/__snapshots__/test_insight_actors_query_runner.ambrsimilarity index 100%rename from posthog/hogql_queries/insights/test/__snapshots__/test_insight_actors_query_runner.ambrrename to posthog/hogql_queries/test/__snapshots__/test_insight_actors_query_runner.ambrdiff --git a/posthog/hogql_queries/test/test_actor_strategies_personhog.py b/posthog/hogql_queries/test/test_actor_strategies_personhog.pyindex 1e8da3706b8a..2580337778ae 100644--- a/posthog/hogql_queries/test/test_actor_strategies_personhog.py+++ b/posthog/hogql_queries/test/test_actor_strategies_personhog.py@@ -9,7 +9,7 @@ from django.utils import timezonefrom posthog.schema import ActorsQueryfrom posthog.hogql_queries.actor_strategies import PersonStrategy-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models import Teamfrom posthog.test.persons import create_person, update_persondiff --git a/posthog/hogql_queries/test/test_actors_query_runner.py b/posthog/hogql_queries/test/test_actors_query_runner.pyindex 798fbe19b7e7..bfa1abf22c0b 100644--- a/posthog/hogql_queries/test/test_actors_query_runner.py+++ b/posthog/hogql_queries/test/test_actors_query_runner.py@@ -728,7 +728,7 @@ class TestActorsQueryRunner(ClickhouseTestMixin, APIBaseTest):assert group["id"] == "org2"assert set(group.keys()) == {"id", "group_type_index"}- @patch("posthog.hogql_queries.insights.paginators.execute_hogql_query", wraps=execute_hogql_query)+ @patch("posthog.hogql_queries.paginators.execute_hogql_query", wraps=execute_hogql_query)def test_funnel_source_with_poe_mode(self, spy_execute_hogql_query):self.team.modifiers = {**(self.team.modifiers or {}),@@ -941,7 +941,7 @@ class TestActorsQueryRunner(ClickhouseTestMixin, APIBaseTest):def test_person_strategy_batches_large_actor_sets(self):"""Verify that PersonStrategy.get_actors batches queries."""from posthog.hogql_queries.actor_strategies import PersonStrategy- from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+ from posthog.hogql_queries.paginators import HogQLHasMorePaginator# Create 5 personsperson_uuids = []diff --git a/posthog/hogql_queries/insights/test/test_insight_actors_query_runner.py b/posthog/hogql_queries/test/test_insight_actors_query_runner.pysimilarity index 99%rename from posthog/hogql_queries/insights/test/test_insight_actors_query_runner.pyrename to posthog/hogql_queries/test/test_insight_actors_query_runner.pyindex fd48dad791fc..b5a3a8b5eba9 100644--- a/posthog/hogql_queries/insights/test/test_insight_actors_query_runner.py+++ b/posthog/hogql_queries/test/test_insight_actors_query_runner.py@@ -27,7 +27,7 @@ from posthog.schema import (from posthog.hogql.query import execute_hogql_queryfrom posthog.hogql_queries.actors_query_runner import ActorsQueryRunner-from posthog.hogql_queries.insights.insight_actors_query_runner import InsightActorsQueryRunner+from posthog.hogql_queries.insight_actors_query_runner import InsightActorsQueryRunnerfrom posthog.models.group.util import create_groupfrom posthog.test.test_utils import create_group_type_mapping_without_created_atdiff --git a/posthog/hogql_queries/insights/test/test_paginators.py b/posthog/hogql_queries/test/test_paginators.pysimilarity index 99%rename from posthog/hogql_queries/insights/test/test_paginators.pyrename to posthog/hogql_queries/test/test_paginators.pyindex f04e3cbac252..55173e357a16 100644--- a/posthog/hogql_queries/insights/test/test_paginators.py+++ b/posthog/hogql_queries/test/test_paginators.py@@ -17,7 +17,7 @@ from posthog.hogql.constants import (from posthog.hogql.parser import parse_selectfrom posthog.hogql_queries.actors_query_runner import ActorsQueryRunner-from posthog.hogql_queries.insights.paginators import HogQLCursorPaginator, HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLCursorPaginator, HogQLHasMorePaginatorfrom posthog.models.utils import UUIDT@@ -207,7 +207,7 @@ class TestHogQLHasMorePaginator(ClickhouseTestMixin, APIBaseTest):self.assertEqual(paginator.limit, case["expected_limit"])self.assertEqual(paginator.offset, case["expected_offset"])- @patch("posthog.hogql_queries.insights.paginators.execute_hogql_query")+ @patch("posthog.hogql_queries.paginators.execute_hogql_query")def test_passes_limit_context(self, mock_execute_hogql_query: MagicMock):limit_context = LimitContext.EXPORTpaginator = HogQLHasMorePaginator.from_limit_context(limit_context=limit_context, limit=5, offset=10)diff --git a/posthog/hogql_queries/insights/utils/aggregations.py b/posthog/hogql_queries/utils/aggregations.pysimilarity index 100%rename from posthog/hogql_queries/insights/utils/aggregations.pyrename to posthog/hogql_queries/utils/aggregations.pydiff --git a/posthog/hogql_queries/insights/utils/breakdowns.py b/posthog/hogql_queries/utils/breakdowns.pysimilarity index 100%rename from posthog/hogql_queries/insights/utils/breakdowns.pyrename to posthog/hogql_queries/utils/breakdowns.pydiff --git a/posthog/hogql_queries/insights/utils/data_warehouse_schema_mixin.py b/posthog/hogql_queries/utils/data_warehouse_schema_mixin.pysimilarity index 94%rename from posthog/hogql_queries/insights/utils/data_warehouse_schema_mixin.pyrename to posthog/hogql_queries/utils/data_warehouse_schema_mixin.pyindex 6cb4c1d5be3d..fce140e6c613 100644--- a/posthog/hogql_queries/insights/utils/data_warehouse_schema_mixin.py+++ b/posthog/hogql_queries/utils/data_warehouse_schema_mixin.py@@ -3,7 +3,7 @@ from rest_framework.exceptions import ValidationErrorfrom posthog.hogql.database.database import Databasefrom posthog.hogql.database.models import DatabaseField, Table-from posthog.hogql_queries.insights.query_context import QueryContextProtocol+from posthog.hogql_queries.query_context import QueryContextProtocoldef resolve_warehouse_field(database: Database, table_name: str, field_name: str) -> DatabaseField:diff --git a/posthog/hogql_queries/insights/utils/entities.py b/posthog/hogql_queries/utils/entities.pysimilarity index 100%rename from posthog/hogql_queries/insights/utils/entities.pyrename to posthog/hogql_queries/utils/entities.pydiff --git a/posthog/hogql_queries/insights/utils/properties.py b/posthog/hogql_queries/utils/properties.pysimilarity index 97%rename from posthog/hogql_queries/insights/utils/properties.pyrename to posthog/hogql_queries/utils/properties.pyindex 2974364669cd..d75862cb3a46 100644--- a/posthog/hogql_queries/insights/utils/properties.py+++ b/posthog/hogql_queries/utils/properties.py@@ -5,7 +5,7 @@ from posthog.schema import PropertyGroupFilter, PropertyGroupFilterValuefrom posthog.hogql import astfrom posthog.hogql.property import property_to_expr-from posthog.hogql_queries.insights.query_context import QueryContext+from posthog.hogql_queries.query_context import QueryContextfrom posthog.types import AnyPropertyFiltertype PropertiesType = list[AnyPropertyFilter] | PropertyGroupFilter | Nonediff --git a/posthog/hogql_queries/insights/utils/test/test_aggregations.py b/posthog/hogql_queries/utils/test/test_aggregations.pysimilarity index 99%rename from posthog/hogql_queries/insights/utils/test/test_aggregations.pyrename to posthog/hogql_queries/utils/test/test_aggregations.pyindex c38383f04971..50639e8a7177 100644--- a/posthog/hogql_queries/insights/utils/test/test_aggregations.py+++ b/posthog/hogql_queries/utils/test/test_aggregations.py@@ -3,7 +3,7 @@ from typing import castfrom posthog.hogql import astfrom posthog.hogql.parser import parse_expr, parse_select-from posthog.hogql_queries.insights.utils.aggregations import FirstTimeForUserEventsQueryAlternator, QueryAlternator+from posthog.hogql_queries.utils.aggregations import FirstTimeForUserEventsQueryAlternator, QueryAlternatorclass TestQueryAlternator:diff --git a/posthog/hogql_queries/insights/utils/test/test_breakdowns.py b/posthog/hogql_queries/utils/test/test_breakdowns.pysimilarity index 97%rename from posthog/hogql_queries/insights/utils/test/test_breakdowns.pyrename to posthog/hogql_queries/utils/test/test_breakdowns.pyindex 845bd762098c..b70f439103e4 100644--- a/posthog/hogql_queries/insights/utils/test/test_breakdowns.py+++ b/posthog/hogql_queries/utils/test/test_breakdowns.py@@ -2,7 +2,7 @@ import pytestfrom posthog.schema import Breakdown, BreakdownFilter, BreakdownType-from posthog.hogql_queries.insights.utils.breakdowns import (+from posthog.hogql_queries.utils.breakdowns import (has_breakdown_filter,has_multi_breakdown,has_single_breakdown,diff --git a/posthog/hogql_queries/insights/utils/test/test_entities.py b/posthog/hogql_queries/utils/test/test_entities.pysimilarity index 99%rename from posthog/hogql_queries/insights/utils/test/test_entities.pyrename to posthog/hogql_queries/utils/test/test_entities.pyindex 9ac9436e9c25..71834a65de55 100644--- a/posthog/hogql_queries/insights/utils/test/test_entities.py+++ b/posthog/hogql_queries/utils/test/test_entities.py@@ -12,7 +12,7 @@ from posthog.schema import (PropertyOperator,)-from posthog.hogql_queries.insights.utils.entities import is_equal, is_superset+from posthog.hogql_queries.utils.entities import is_equal, is_supersetfrom posthog.types import EntityNodetestdata_equals: list[tuple[EntityNode, EntityNode, bool]] = [diff --git a/posthog/hogql_queries/insights/utils/utils.py b/posthog/hogql_queries/utils/utils.pysimilarity index 100%rename from posthog/hogql_queries/insights/utils/utils.pyrename to posthog/hogql_queries/utils/utils.pydiff --git a/posthog/hogql_queries/validation/rules.py b/posthog/hogql_queries/validation/rules.pyindex 3555e919ceb5..bc94b3c9b4ae 100644--- a/posthog/hogql_queries/validation/rules.py+++ b/posthog/hogql_queries/validation/rules.py@@ -2,8 +2,8 @@ from rest_framework.exceptions import ValidationErrorfrom posthog.schema import EntityType, FunnelsQuery, LifecycleQuery, RetentionQuery, StickinessQuery, TrendsQuery-from posthog.hogql_queries.insights.utils.entities import has_data_warehouse_node-from posthog.hogql_queries.insights.utils.properties import has_any_property_filters+from posthog.hogql_queries.utils.entities import has_data_warehouse_node+from posthog.hogql_queries.utils.properties import has_any_property_filtersfrom posthog.hogql_queries.validation.utils import get_query_insight_namefrom posthog.hogql_queries.validation.validation import QueryValidationContextdiff --git a/posthog/queries/actor_base_query.py b/posthog/queries/actor_base_query.pyindex af1d115ec0b1..7cee093af59b 100644--- a/posthog/queries/actor_base_query.py+++ b/posthog/queries/actor_base_query.py@@ -9,7 +9,7 @@ import structlogfrom posthog.schema import ActorsQueryfrom posthog.hogql_queries.actor_strategies import PersonStrategy-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models import Teamfrom posthog.models.group import Groupfrom posthog.models.person import Persondiff --git a/posthog/schema_helpers.py b/posthog/schema_helpers.pyindex 81a221e8786c..654d6e8c9205 100644--- a/posthog/schema_helpers.py+++ b/posthog/schema_helpers.py@@ -14,7 +14,7 @@ from posthog.schema import (TrendsQuery,)-from posthog.hogql_queries.insights.utils.utils import series_should_be_set_to_dau+from posthog.hogql_queries.utils.utils import series_should_be_set_to_daufrom posthog.types import InsightQueryNodediff --git a/posthog/session_recordings/queries/session_recording_list_from_query.py b/posthog/session_recordings/queries/session_recording_list_from_query.pyindex 12705b4bd387..332b870f378a 100644--- a/posthog/session_recordings/queries/session_recording_list_from_query.py+++ b/posthog/session_recordings/queries/session_recording_list_from_query.py@@ -21,7 +21,7 @@ from posthog.hogql.property import property_to_exprfrom posthog.clickhouse.client.connection import ClickHouseUserfrom posthog.exceptions_capture import capture_exception-from posthog.hogql_queries.insights.paginators import HogQLCursorPaginator, HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLCursorPaginator, HogQLHasMorePaginatorfrom posthog.models import Team, Userfrom posthog.session_recordings.models.metadata import ONGOING_SESSION_WINDOW_MINUTESfrom posthog.session_recordings.queries.sub_queries.base_query import SessionRecordingsListingBaseQuerydiff --git a/posthog/session_recordings/queries/test/listing_recordings/test_session_recordings_list_by_experiment_exposure.py b/posthog/session_recordings/queries/test/listing_recordings/test_session_recordings_list_by_experiment_exposure.pyindex a9a596780da3..46ec3f94d691 100644--- a/posthog/session_recordings/queries/test/listing_recordings/test_session_recordings_list_by_experiment_exposure.py+++ b/posthog/session_recordings/queries/test/listing_recordings/test_session_recordings_list_by_experiment_exposure.py@@ -16,7 +16,7 @@ from posthog.hogql.constants import HogQLGlobalSettingsfrom posthog.clickhouse.client import sync_executefrom posthog.constants import AvailableFeaturefrom posthog.exceptions import ClickHouseQueryMemoryLimitExceeded-from posthog.hogql_queries.insights.paginators import HogQLCursorPaginator+from posthog.hogql_queries.paginators import HogQLCursorPaginatorfrom posthog.models import Userfrom posthog.models.personal_api_key import PersonalAPIKeyfrom posthog.models.team.extensions import get_or_create_team_extensiondiff --git a/posthog/tasks/alerts/trends.py b/posthog/tasks/alerts/trends.pyindex a95b5d6c738c..231d3de54ce7 100644--- a/posthog/tasks/alerts/trends.py+++ b/posthog/tasks/alerts/trends.py@@ -5,7 +5,7 @@ import numpy as npfrom posthog.schema import FunnelsQuery, IntervalType, TrendsAlertConfig, TrendsQueryfrom posthog.caching.insight_result import InsightResult-from posthog.hogql_queries.insights.utils.breakdowns import has_breakdown_filter+from posthog.hogql_queries.utils.breakdowns import has_breakdown_filterfrom posthog.tasks.alerts.utils import NON_TIME_SERIES_DISPLAY_TYPESdiff --git a/posthog/test/base.py b/posthog/test/base.pyindex f064054374b5..9a808fcfddfb 100644--- a/posthog/test/base.py+++ b/posthog/test/base.py@@ -84,7 +84,7 @@ from posthog.clickhouse.query_log_archive import (from posthog.cloud_utils import TEST_clear_instance_license_cachefrom posthog.helpers.two_factor_session import code_based_verification_token_generatorfrom posthog.hogql_queries.ai.ai_table_resolver import AI_EVENT_NAMES as _AI_EVENT_TYPES-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models import Organization, Team, Userfrom posthog.models.ai_events.sql import TRUNCATE_AI_EVENTS_TABLE_SQLfrom posthog.models.channel_type.sql import (diff --git a/posthog/test/repo_invariants/dataclass_frozen_baseline.txt b/posthog/test/repo_invariants/dataclass_frozen_baseline.txtindex de5a9d56e805..9c10eeeec2a2 100644--- a/posthog/test/repo_invariants/dataclass_frozen_baseline.txt+++ b/posthog/test/repo_invariants/dataclass_frozen_baseline.txt@@ -34,7 +34,7 @@1 posthog/hogql/transforms/lazy_tables.py1 posthog/hogql/transforms/test/test_property_types.py1 posthog/hogql/transforms/test/test_property_types_dmat.py-1 posthog/hogql_queries/insights/utils/aggregations.py+1 posthog/hogql_queries/utils/aggregations.py1 posthog/kafka_client/client.py1 posthog/management/commands/audit_encrypted_field_keys.py1 posthog/management/commands/backfill_distinct_id_overrides.pydiff --git a/products/alerts/backend/evaluation/trends.py b/products/alerts/backend/evaluation/trends.pyindex 0a968bf54d36..0f54c07ca89a 100644--- a/products/alerts/backend/evaluation/trends.py+++ b/products/alerts/backend/evaluation/trends.py@@ -15,7 +15,7 @@ from posthog.api.services.query import ExecutionModefrom posthog.caching.calculate_results import calculate_for_query_based_insightfrom posthog.caching.insight_result import InsightResultfrom posthog.event_usage import EventSource-from posthog.hogql_queries.insights.utils.breakdowns import humanize_breakdown_label+from posthog.hogql_queries.utils.breakdowns import humanize_breakdown_label# These helpers also back the anomaly detector, so they remain in the tasks module for now.from posthog.tasks.alerts.trends import (diff --git a/products/customer_analytics/backend/hogql_queries/accounts_query_runner.py b/products/customer_analytics/backend/hogql_queries/accounts_query_runner.pyindex e02cdb6512be..1addf874eff1 100644--- a/products/customer_analytics/backend/hogql_queries/accounts_query_runner.py+++ b/products/customer_analytics/backend/hogql_queries/accounts_query_runner.py@@ -9,7 +9,7 @@ from posthog.hogql.parser import parse_expr, parse_order_expr, parse_selectfrom posthog.hogql.query import execute_hogql_queryfrom posthog.errors import ExposedCHQueryError, InternalCHQueryError-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.models import Userdiff --git a/products/endpoints/backend/logic/strategies.py b/products/endpoints/backend/logic/strategies.pyindex 669c00cf1fca..fa9f5e2a4e22 100644--- a/products/endpoints/backend/logic/strategies.py+++ b/products/endpoints/backend/logic/strategies.py@@ -32,7 +32,7 @@ from posthog.hogql.visitor import CloningVisitorfrom posthog.clickhouse.query_tagging import Productfrom posthog.exceptions_capture import capture_exception-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABELfrom posthog.models.team import Teamfrom posthog.schema_migrations.upgrade import upgradediff --git a/products/endpoints/backend/materialization_transforms.py b/products/endpoints/backend/materialization_transforms.pyindex 1002871cb509..512ef648649c 100644--- a/products/endpoints/backend/materialization_transforms.py+++ b/products/endpoints/backend/materialization_transforms.py@@ -18,8 +18,8 @@ from posthog.hogql.visitor import CloningVisitor, TraversingVisitor, clone_exprfrom posthog.dataclasses import frozenfrom posthog.exceptions_capture import capture_exception-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABELfrom posthog.hogql_queries.query_runner import get_query_runner+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABELfrom posthog.models import Userfrom posthog.models.team import Teamfrom posthog.schema_migrations.upgrade import upgradediff --git a/products/endpoints/backend/tests/test_endpoint_execution.py b/products/endpoints/backend/tests/test_endpoint_execution.pyindex d9ca63002eee..fcc32a019228 100644--- a/products/endpoints/backend/tests/test_endpoint_execution.py+++ b/products/endpoints/backend/tests/test_endpoint_execution.py@@ -1879,7 +1879,7 @@ class TestEndpointExecution(ClickhouseTestMixin, APIBaseTest):self.assertIsNone(results[1][0])def test_inline_insight_cleans_other_sentinel_and_alerts(self):- from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABEL+ from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABELfor event_name in [f"event_{i}" for i in range(30)]:_create_event(diff --git a/products/endpoints/backend/tests/test_endpoint_materialization.py b/products/endpoints/backend/tests/test_endpoint_materialization.pyindex a3c4bc2cdea1..918906f19f74 100644--- a/products/endpoints/backend/tests/test_endpoint_materialization.py+++ b/products/endpoints/backend/tests/test_endpoint_materialization.py@@ -1697,10 +1697,7 @@ class TestEndpointMaterialization(ClickhouseTestMixin, APIBaseTest):self.assertFalse(Node.objects.filter(team=self.team, saved_query_id=saved_query_id).exists())def test_materialization_replaces_breakdown_sentinels_in_hogql(self):- from posthog.hogql_queries.insights.utils.breakdowns import (- BREAKDOWN_NULL_STRING_LABEL,- BREAKDOWN_OTHER_STRING_LABEL,- )+ from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL, BREAKDOWN_OTHER_STRING_LABELtrends_query = {"kind": "TrendsQuery",diff --git a/products/engineering_analytics/backend/management/commands/seed_engineering_analytics.py b/products/engineering_analytics/backend/management/commands/seed_engineering_analytics.pyindex aacfefb9ac37..d66b20733450 100644--- a/products/engineering_analytics/backend/management/commands/seed_engineering_analytics.py+++ b/products/engineering_analytics/backend/management/commands/seed_engineering_analytics.py@@ -640,7 +640,7 @@ _SPAN_TEAMS: list[tuple[str, str, list[tuple[str, str, int, int]]]] = [),("team-product-analytics", # mildly improving- "posthog/hogql_queries/insights/test",+ "posthog/hogql_queries/insights/trends/test",[("TestTrendsQueryRunner", "test_interval_boundary_timezone", 3, 2),("TestFunnelCorrelation", "test_person_property_breakdown", 1, 1),diff --git a/products/error_tracking/backend/hogql_queries/error_tracking_breakdowns_query_runner.py b/products/error_tracking/backend/hogql_queries/error_tracking_breakdowns_query_runner.pyindex 4f636d5715ab..42ec79a19684 100644--- a/products/error_tracking/backend/hogql_queries/error_tracking_breakdowns_query_runner.py+++ b/products/error_tracking/backend/hogql_queries/error_tracking_breakdowns_query_runner.py@@ -13,8 +13,8 @@ from posthog.hogql import astfrom posthog.hogql.property import property_to_exprfrom posthog.hogql.query import execute_hogql_query-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABELfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunner+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABELfrom posthog.utils import relative_date_parsefrom products.error_tracking.backend.hogql_queries.access import ErrorTrackingQueryRunnerAccessMixindiff --git a/products/error_tracking/backend/hogql_queries/error_tracking_issue_correlation_query_runner.py b/products/error_tracking/backend/hogql_queries/error_tracking_issue_correlation_query_runner.pyindex 07b5abc41d7b..5b3e271890a7 100644--- a/products/error_tracking/backend/hogql_queries/error_tracking_issue_correlation_query_runner.py+++ b/products/error_tracking/backend/hogql_queries/error_tracking_issue_correlation_query_runner.py@@ -17,7 +17,7 @@ from posthog.hogql import astfrom posthog.hogql.constants import LimitContextfrom posthog.hogql.parser import parse_select-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom products.error_tracking.backend.hogql_queries.access import ErrorTrackingQueryRunnerAccessMixindiff --git a/products/error_tracking/backend/hogql_queries/error_tracking_query_runner.py b/products/error_tracking/backend/hogql_queries/error_tracking_query_runner.pyindex 88535f904db2..cd283f3274d3 100644--- a/products/error_tracking/backend/hogql_queries/error_tracking_query_runner.py+++ b/products/error_tracking/backend/hogql_queries/error_tracking_query_runner.py@@ -15,7 +15,7 @@ from posthog.hogql.database.schema.error_tracking_recent_issue_state import RECEfrom posthog.hogql.parser import parse_selectfrom posthog.hogql.query import execute_hogql_query-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.models.filters.mixins.utils import cached_propertyfrom posthog.utils import relative_date_parsediff --git a/products/error_tracking/backend/hogql_queries/error_tracking_similar_issues_query_runner.py b/products/error_tracking/backend/hogql_queries/error_tracking_similar_issues_query_runner.pyindex dbb7c28f01df..9a43ff113cd7 100644--- a/products/error_tracking/backend/hogql_queries/error_tracking_similar_issues_query_runner.py+++ b/products/error_tracking/backend/hogql_queries/error_tracking_similar_issues_query_runner.py@@ -23,7 +23,7 @@ from posthog.hogql.constants import LimitContextfrom posthog.hogql.parser import parse_selectfrom posthog.hogql.query import execute_hogql_query-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom products.error_tracking.backend.hogql_queries.access import ErrorTrackingQueryRunnerAccessMixindiff --git a/products/experiments/backend/hogql_queries/breakdown_injector.py b/products/experiments/backend/hogql_queries/breakdown_injector.pyindex 7e99d393209a..2e9cf19b8ed0 100644--- a/products/experiments/backend/hogql_queries/breakdown_injector.py+++ b/products/experiments/backend/hogql_queries/breakdown_injector.py@@ -21,7 +21,7 @@ from posthog.hogql import astfrom posthog.hogql.parser import parse_exprfrom posthog.hogql_queries.insights.trends.utils import get_properties_chain-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABELclass BreakdownInjector:diff --git a/products/experiments/backend/hogql_queries/experiment_retention_query_builder.py b/products/experiments/backend/hogql_queries/experiment_retention_query_builder.pyindex 00ef2ef47268..4865e0f82aa4 100644--- a/products/experiments/backend/hogql_queries/experiment_retention_query_builder.py+++ b/products/experiments/backend/hogql_queries/experiment_retention_query_builder.py@@ -14,7 +14,7 @@ from posthog.schema import (from posthog.hogql import astfrom posthog.hogql.parser import parse_expr, parse_select-from posthog.hogql_queries.insights.utils.utils import get_start_of_interval_hogql+from posthog.hogql_queries.utils.utils import get_start_of_interval_hogqlfrom products.experiments.backend.hogql_queries.base_query_utils import (conversion_window_to_seconds,diff --git a/products/experiments/backend/hogql_queries/test/experiment_query_runner/test_breakdown.py b/products/experiments/backend/hogql_queries/test/experiment_query_runner/test_breakdown.pyindex c521a471befb..ad798978d054 100644--- a/products/experiments/backend/hogql_queries/test/experiment_query_runner/test_breakdown.py+++ b/products/experiments/backend/hogql_queries/test/experiment_query_runner/test_breakdown.py@@ -23,7 +23,7 @@ from posthog.schema import (StepOrderValue,)-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABELfrom products.experiments.backend.hogql_queries.experiment_query_runner import ExperimentQueryRunnerfrom products.experiments.backend.hogql_queries.test.experiment_query_runner.base import ExperimentQueryRunnerBaseTestdiff --git a/products/experiments/backend/hogql_queries/test/test_experiment_utils.py b/products/experiments/backend/hogql_queries/test/test_experiment_utils.pyindex 1f59a1c3ff0c..a4153dc12285 100644--- a/products/experiments/backend/hogql_queries/test/test_experiment_utils.py+++ b/products/experiments/backend/hogql_queries/test/test_experiment_utils.py@@ -18,7 +18,7 @@ from posthog.schema import (StartHandling,)-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_NULL_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_NULL_STRING_LABELfrom products.experiments.backend.hogql_queries.utils import (aggregate_variants_across_breakdowns,diff --git a/products/exports/backend/tasks/csv_exporter.py b/products/exports/backend/tasks/csv_exporter.pyindex c0c4eba97d54..250e4ca88e0a 100644--- a/products/exports/backend/tasks/csv_exporter.py+++ b/products/exports/backend/tasks/csv_exporter.py@@ -30,13 +30,13 @@ from posthog.api.services.query import process_query_dictfrom posthog.event_usage import AnalyticsProps, EventSourcefrom posthog.exceptions import ClickHouseQuerySizeExceededfrom posthog.exceptions_capture import capture_exception-from posthog.hogql_queries.insights.utils.breakdowns import (+from posthog.hogql_queries.query_runner import ExecutionMode+from posthog.hogql_queries.utils.breakdowns import (BREAKDOWN_NULL_DISPLAY,BREAKDOWN_NULL_STRING_LABEL,BREAKDOWN_OTHER_DISPLAY,BREAKDOWN_OTHER_STRING_LABEL,)-from posthog.hogql_queries.query_runner import ExecutionModefrom posthog.jwt import PosthogJwtAudience, encode_jwtfrom posthog.query_creator_access import creator_access_revoked, report_creator_access_revokedfrom posthog.security.spreadsheet_safety import sanitize_formula_injectiondiff --git a/products/logs/backend/logs_query_runner.py b/products/logs/backend/logs_query_runner.pyindex 2259e04cb912..87d87c2e05b0 100644--- a/products/logs/backend/logs_query_runner.py+++ b/products/logs/backend/logs_query_runner.py@@ -24,7 +24,7 @@ from posthog.hogql.parser import parse_expr, parse_order_expr, parse_selectfrom posthog.hogql.property import get_lowercase_index_hint, operator_is_negative, property_to_exprfrom posthog.clickhouse.client.connection import Workload-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunner, QueryRunnerfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.models.filters.mixins.utils import cached_propertydiff --git a/products/logs/backend/sparkline_query_runner.py b/products/logs/backend/sparkline_query_runner.pyindex 66d60dde509e..764cbe3dbc20 100644--- a/products/logs/backend/sparkline_query_runner.py+++ b/products/logs/backend/sparkline_query_runner.py@@ -8,7 +8,7 @@ from posthog.hogql.parser import parse_selectfrom posthog.hogql.query import execute_hogql_queryfrom posthog.clickhouse.client.connection import Workload-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABELfrom posthog.models.filters.mixins.utils import cached_propertyfrom products.logs.backend.logs_query_runner import LogsQueryResponse, LogsQueryRunnerdiff --git a/products/logs/backend/test/test_sparkline_query_runner.py b/products/logs/backend/test/test_sparkline_query_runner.pyindex 6f1d9ed35eb7..7f2e221ce226 100644--- a/products/logs/backend/test/test_sparkline_query_runner.py+++ b/products/logs/backend/test/test_sparkline_query_runner.py@@ -11,7 +11,7 @@ from django.urls import get_resolverfrom rest_framework import statusfrom posthog.clickhouse.client import sync_execute-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABELfrom products.logs.backend.sparkline_query_runner import SPARKLINE_TOP_BREAKDOWN_VALUESdiff --git a/products/logs/frontend/components/LogsFilterPreview/logsFilterVolumePreview.test.ts b/products/logs/frontend/components/LogsFilterPreview/logsFilterVolumePreview.test.tsindex 6bf18885af86..e21dd307ee3d 100644--- a/products/logs/frontend/components/LogsFilterPreview/logsFilterVolumePreview.test.ts+++ b/products/logs/frontend/components/LogsFilterPreview/logsFilterVolumePreview.test.ts@@ -36,7 +36,7 @@ describe('constants shared with the backend', () => {it('uses the same collapsed-bucket sentinel the backend emits', () => {// A mismatch would leave the sentinel unrecognised and drawn as a service literally named// "$$_posthog_breakdown_other_$$".- const breakdowns = readSource('../posthog/hogql_queries/insights/utils/breakdowns.py')+ const breakdowns = readSource('../posthog/hogql_queries/utils/breakdowns.py')const match = breakdowns.match(/^BREAKDOWN_OTHER_STRING_LABEL = "(.+)"$/m)expect(match).not.toBeNull()expect(match![1]).toEqual(OTHER_BREAKDOWN_VALUE)diff --git a/products/marketing_analytics/backend/hogql_queries/marketing_analytics_table_query_runner.py b/products/marketing_analytics/backend/hogql_queries/marketing_analytics_table_query_runner.pyindex cd5badedefbd..bec9ad693e77 100644--- a/products/marketing_analytics/backend/hogql_queries/marketing_analytics_table_query_runner.py+++ b/products/marketing_analytics/backend/hogql_queries/marketing_analytics_table_query_runner.py@@ -17,7 +17,7 @@ from posthog.hogql import astfrom posthog.hogql.constants import MAX_BYTES_BEFORE_EXTERNAL_GROUP_BY, HogQLGlobalSettingsfrom posthog.hogql.query import execute_hogql_query-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom .constants import (BASE_COLUMN_MAPPING,diff --git a/products/marketing_analytics/backend/hogql_queries/marketing_retention_query_runner.py b/products/marketing_analytics/backend/hogql_queries/marketing_retention_query_runner.pyindex f8a6e554df38..2a26255d806d 100644--- a/products/marketing_analytics/backend/hogql_queries/marketing_retention_query_runner.py+++ b/products/marketing_analytics/backend/hogql_queries/marketing_retention_query_runner.py@@ -27,9 +27,9 @@ from posthog.hogql.constants import MAX_BYTES_BEFORE_EXTERNAL_GROUP_BY, HogQLGlofrom posthog.hogql.property import property_to_exprfrom posthog.hogql.query import execute_hogql_query-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABEL-from posthog.hogql_queries.insights.utils.utils import get_start_of_interval_hogql+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABELfrom posthog.hogql_queries.utils.query_date_range import QueryDateRange, date_to_start_of_interval+from posthog.hogql_queries.utils.utils import get_start_of_interval_hogqlfrom .session_breakdown_base import MarketingSessionBreakdownQueryRunnerBasediff --git a/products/marketing_analytics/backend/hogql_queries/non_integrated_conversions_table_query_runner.py b/products/marketing_analytics/backend/hogql_queries/non_integrated_conversions_table_query_runner.pyindex b9baaeeb87dc..12e89a00e704 100644--- a/products/marketing_analytics/backend/hogql_queries/non_integrated_conversions_table_query_runner.py+++ b/products/marketing_analytics/backend/hogql_queries/non_integrated_conversions_table_query_runner.py@@ -16,7 +16,7 @@ from posthog.hogql import astfrom posthog.hogql.constants import MAX_BYTES_BEFORE_EXTERNAL_GROUP_BY, HogQLGlobalSettingsfrom posthog.hogql.query import execute_hogql_query-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom .constants import DEFAULT_LIMIT, PAGINATION_EXTRA, UNIFIED_CONVERSION_GOALS_CTE_ALIAS, to_marketing_analytics_datafrom .conversion_goals_aggregator import ConversionGoalsAggregatordiff --git a/products/marketing_analytics/backend/hogql_queries/test_marketing_retention_query_runner.py b/products/marketing_analytics/backend/hogql_queries/test_marketing_retention_query_runner.pyindex 6b3a05573cab..4d564073423a 100644--- a/products/marketing_analytics/backend/hogql_queries/test_marketing_retention_query_runner.py+++ b/products/marketing_analytics/backend/hogql_queries/test_marketing_retention_query_runner.py@@ -16,7 +16,7 @@ from posthog.schema import (from posthog.hogql.constants import MAX_SELECT_RETENTION_LIMITfrom posthog.hogql.test.utils import pretty_print_in_tests-from posthog.hogql_queries.insights.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import BREAKDOWN_OTHER_STRING_LABELfrom posthog.models.team import WeekStartDayfrom posthog.models.utils import uuid7from posthog.test.persons import create_persondiff --git a/products/model_crossing_uses_baseline.txt b/products/model_crossing_uses_baseline.txtindex 2c6415767146..d68634cda91b 100644--- a/products/model_crossing_uses_baseline.txt+++ b/products/model_crossing_uses_baseline.txt@@ -841,10 +841,10 @@ web_analytics:backend/hogql_queries/ posthog.hogql.functions.test.test_traffic_tweb_analytics:backend/hogql_queries/ posthog.hogql.functions.test.test_traffic_type_real_ua drives(CATEGORY_TO_TRAFFIC_CATEGORY) 2web_analytics:backend/hogql_queries/ posthog.hogql.transforms.test.test_preaggregated_table_transformation drives(EVENT_PROPERTY_TO_FIELD) 4web_analytics:backend/hogql_queries/ posthog.hogql.transforms.test.test_preaggregated_table_transformation drives(SESSION_PROPERTY_TO_FIELD) 4-web_analytics:backend/hogql_queries/ posthog.hogql_queries.insights.test.test_insight_actors_query_runner drives(TrendsQuery) 7web_analytics:backend/hogql_queries/ posthog.hogql_queries.insights.trends.test.test_trends_data_warehouse_query drives(TrendsQuery) 23web_analytics:backend/hogql_queries/ posthog.hogql_queries.insights.trends.test.test_trends_query_builder drives(TrendsQuery) 7web_analytics:backend/hogql_queries/ posthog.hogql_queries.insights.trends.test.test_trends_query_runner drives(TrendsQuery) 2+web_analytics:backend/hogql_queries/ posthog.hogql_queries.test.test_insight_actors_query_runner drives(TrendsQuery) 7web_analytics:backend/hogql_queries/ posthog.hogql_queries.test.test_query_runner drives(TrendsQuery) 4web_analytics:backend/hogql_queries/ posthog.models.web_preaggregated.test_web_pre_aggregated_timezones drives(FloatAwareTestCase) 1web_analytics:backend/hogql_queries/ posthog.models.web_preaggregated.test_web_pre_aggregated_timezones drives(WebAnalyticsPreAggregatedTestBase) 1diff --git a/products/product_analytics/backend/hogql_queries/funnels/base.py b/products/product_analytics/backend/hogql_queries/funnels/base.pyindex bae3058fc3dd..a17690cba59a 100644--- a/products/product_analytics/backend/hogql_queries/funnels/base.py+++ b/products/product_analytics/backend/hogql_queries/funnels/base.py@@ -20,8 +20,8 @@ from posthog.hogql.constants import get_breakdown_limit_for_contextfrom posthog.hogql.parser import parse_expr, parse_selectfrom posthog.clickhouse.materialized_columns import ColumnName-from posthog.hogql_queries.insights.utils.breakdowns import ALL_USERS_COHORT_ID-from posthog.hogql_queries.insights.utils.entities import is_equal, is_superset+from posthog.hogql_queries.utils.breakdowns import ALL_USERS_COHORT_ID+from posthog.hogql_queries.utils.entities import is_equal, is_supersetfrom posthog.models.property.property import PropertyNamefrom posthog.queries.util import correct_result_for_samplingfrom posthog.types import FunnelEntityNodediff --git a/products/product_analytics/backend/hogql_queries/funnels/funnel.py b/products/product_analytics/backend/hogql_queries/funnels/funnel.pyindex 77269ebcda9f..b35cbe4d0287 100644--- a/products/product_analytics/backend/hogql_queries/funnels/funnel.py+++ b/products/product_analytics/backend/hogql_queries/funnels/funnel.py@@ -8,7 +8,7 @@ from posthog.hogql import astfrom posthog.hogql.constants import DEFAULT_RETURNED_ROWS, HogQLQuerySettingsfrom posthog.hogql.parser import parse_expr, parse_select-from posthog.hogql_queries.insights.utils.breakdowns import NOT_IN_COHORT_ID+from posthog.hogql_queries.utils.breakdowns import NOT_IN_COHORT_IDfrom posthog.utils import DATERANGE_MAPfrom products.product_analytics.backend.hogql_queries.funnels.base import JOIN_ALGOS, FunnelBasediff --git a/products/product_analytics/backend/hogql_queries/funnels/funnel_aggregation_operations.py b/products/product_analytics/backend/hogql_queries/funnels/funnel_aggregation_operations.pyindex 9bd44e4b9af6..9e374c6bfd99 100644--- a/products/product_analytics/backend/hogql_queries/funnels/funnel_aggregation_operations.py+++ b/products/product_analytics/backend/hogql_queries/funnels/funnel_aggregation_operations.py@@ -2,7 +2,7 @@ from typing import castfrom posthog.hogql import ast-from posthog.hogql_queries.insights.utils.aggregations import (+from posthog.hogql_queries.utils.aggregations import (FirstTimeForUserDataWarehouseConfig,FirstTimeForUserEventsQueryAlternator,)diff --git a/products/product_analytics/backend/hogql_queries/funnels/funnel_event_query.py b/products/product_analytics/backend/hogql_queries/funnels/funnel_event_query.pyindex 840e7aab2191..f153605640be 100644--- a/products/product_analytics/backend/hogql_queries/funnels/funnel_event_query.py+++ b/products/product_analytics/backend/hogql_queries/funnels/funnel_event_query.py@@ -29,10 +29,10 @@ from posthog.hogql.property import action_to_expr, property_to_exprfrom posthog.clickhouse.materialized_columns import ColumnNamefrom posthog.clickhouse.query_tagging import tag_contains_user_hogql-from posthog.hogql_queries.insights.utils.aggregations import FirstTimeForUserDataWarehouseConfig-from posthog.hogql_queries.insights.utils.breakdowns import NOT_IN_COHORT_ID, strip_user_aliases-from posthog.hogql_queries.insights.utils.data_warehouse_schema_mixin import DataWarehouseSchemaMixin-from posthog.hogql_queries.insights.utils.properties import Properties+from posthog.hogql_queries.utils.aggregations import FirstTimeForUserDataWarehouseConfig+from posthog.hogql_queries.utils.breakdowns import NOT_IN_COHORT_ID, strip_user_aliases+from posthog.hogql_queries.utils.data_warehouse_schema_mixin import DataWarehouseSchemaMixin+from posthog.hogql_queries.utils.properties import Propertiesfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.models.property.property import PropertyNamefrom posthog.types import FunnelEntityNode, FunnelExclusionEntityNodediff --git a/products/product_analytics/backend/hogql_queries/funnels/funnel_query_context.py b/products/product_analytics/backend/hogql_queries/funnels/funnel_query_context.pyindex b5dbfbb79a88..049e7d33a41c 100644--- a/products/product_analytics/backend/hogql_queries/funnels/funnel_query_context.py+++ b/products/product_analytics/backend/hogql_queries/funnels/funnel_query_context.py@@ -15,7 +15,7 @@ from posthog.schema import (from posthog.hogql.constants import LimitContextfrom posthog.hogql.timings import HogQLTimings-from posthog.hogql_queries.insights.query_context import QueryContext+from posthog.hogql_queries.query_context import QueryContextfrom posthog.models.property.util import box_valuefrom posthog.models.team.team import Teamfrom posthog.models.user import Userdiff --git a/products/product_analytics/backend/hogql_queries/funnels/funnel_trends.py b/products/product_analytics/backend/hogql_queries/funnels/funnel_trends.pyindex 2f0079b2a7ba..2aec0a14c2f9 100644--- a/products/product_analytics/backend/hogql_queries/funnels/funnel_trends.py+++ b/products/product_analytics/backend/hogql_queries/funnels/funnel_trends.py@@ -10,10 +10,10 @@ from posthog.hogql import astfrom posthog.hogql.constants import HogQLQuerySettingsfrom posthog.hogql.parser import parse_expr, parse_select-from posthog.hogql_queries.insights.utils.breakdowns import NOT_IN_COHORT_ID-from posthog.hogql_queries.insights.utils.utils import get_start_of_interval_hogql, get_start_of_interval_hogql_str+from posthog.hogql_queries.utils.breakdowns import NOT_IN_COHORT_IDfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.hogql_queries.utils.timestamp_utils import format_label_date, get_earliest_timestamp_unfiltered+from posthog.hogql_queries.utils.utils import get_start_of_interval_hogql, get_start_of_interval_hogql_strfrom posthog.interval_specs import get_interval_funcfrom posthog.queries.util import correct_result_for_samplingfrom posthog.utils import DATERANGE_MAP, relative_date_parsediff --git a/products/product_analytics/backend/hogql_queries/funnels/funnel_validation_rules.py b/products/product_analytics/backend/hogql_queries/funnels/funnel_validation_rules.pyindex 6527858e03df..c1e15fdcce8f 100644--- a/products/product_analytics/backend/hogql_queries/funnels/funnel_validation_rules.py+++ b/products/product_analytics/backend/hogql_queries/funnels/funnel_validation_rules.py@@ -4,7 +4,7 @@ from rest_framework.exceptions import ValidationErrorfrom posthog.schema import FunnelsQuery, FunnelVizType, StepOrderValue-from posthog.hogql_queries.insights.utils.entities import is_equal, is_superset+from posthog.hogql_queries.utils.entities import is_equal, is_supersetfrom posthog.hogql_queries.validation.validation import QueryValidationContextdiff --git a/products/product_analytics/backend/hogql_queries/funnels/funnels_query_runner.py b/products/product_analytics/backend/hogql_queries/funnels/funnels_query_runner.pyindex b5f8c61c157e..243306b15d78 100644--- a/products/product_analytics/backend/hogql_queries/funnels/funnels_query_runner.py+++ b/products/product_analytics/backend/hogql_queries/funnels/funnels_query_runner.py@@ -33,7 +33,8 @@ from posthog.hogql.timings import HogQLTimingsfrom posthog.caching.insights_api import BASE_MINIMUM_INSIGHT_REFRESH_INTERVAL, REDUCED_MINIMUM_INSIGHT_REFRESH_INTERVALfrom posthog.clickhouse import query_taggingfrom posthog.clickhouse.query_tagging import QueryTags-from posthog.hogql_queries.insights.utils.breakdowns import (+from posthog.hogql_queries.query_runner import AnalyticsQueryRunner, ExecutionMode+from posthog.hogql_queries.utils.breakdowns import (ALL_USERS_COHORT_ID,BREAKDOWN_BASELINE_DISPLAY,BREAKDOWN_BASELINE_STRING_LABEL,@@ -41,7 +42,6 @@ from posthog.hogql_queries.insights.utils.breakdowns import (has_breakdown_filter,humanize_breakdown_label,)-from posthog.hogql_queries.query_runner import AnalyticsQueryRunner, ExecutionModefrom posthog.hogql_queries.utils.query_compare_to_date_range import QueryCompareToDateRangefrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.hogql_queries.utils.query_previous_period_date_range import QueryPreviousPeriodDateRangediff --git a/products/product_analytics/backend/hogql_queries/funnels/test/breakdown_cases.py b/products/product_analytics/backend/hogql_queries/funnels/test/breakdown_cases.pyindex 8ed7dea2408a..f36406b0eb18 100644--- a/products/product_analytics/backend/hogql_queries/funnels/test/breakdown_cases.py+++ b/products/product_analytics/backend/hogql_queries/funnels/test/breakdown_cases.py@@ -32,7 +32,7 @@ from posthog.schema import ()from posthog.constants import FunnelOrderType-from posthog.hogql_queries.insights.utils.breakdowns import ALL_USERS_COHORT_ID, NOT_IN_COHORT_ID+from posthog.hogql_queries.utils.breakdowns import ALL_USERS_COHORT_ID, NOT_IN_COHORT_IDfrom posthog.models.group.util import create_groupfrom posthog.models.instance_setting import override_instance_configfrom posthog.test.test_journeys import journeys_fordiff --git a/products/product_analytics/backend/hogql_queries/funnels/test/test_funnel_actors_query_options.py b/products/product_analytics/backend/hogql_queries/funnels/test/test_funnel_actors_query_options.pyindex 61b81d5ed24a..9cb95f38768f 100644--- a/products/product_analytics/backend/hogql_queries/funnels/test/test_funnel_actors_query_options.py+++ b/products/product_analytics/backend/hogql_queries/funnels/test/test_funnel_actors_query_options.py@@ -18,8 +18,8 @@ from posthog.schema import (InsightActorsQueryOptions,)-from posthog.hogql_queries.insights.insight_actors_query_options_runner import InsightActorsQueryOptionsRunner-from posthog.hogql_queries.insights.utils.breakdowns import (+from posthog.hogql_queries.insight_actors_query_options_runner import InsightActorsQueryOptionsRunner+from posthog.hogql_queries.utils.breakdowns import (ALL_USERS_COHORT_ID,BREAKDOWN_BASELINE_DISPLAY,BREAKDOWN_BASELINE_STRING_LABEL,diff --git a/products/product_analytics/backend/hogql_queries/funnels/test/test_funnel_aggregation_operations.py b/products/product_analytics/backend/hogql_queries/funnels/test/test_funnel_aggregation_operations.pyindex 8046051dfb97..07425d7a5b3c 100644--- a/products/product_analytics/backend/hogql_queries/funnels/test/test_funnel_aggregation_operations.py+++ b/products/product_analytics/backend/hogql_queries/funnels/test/test_funnel_aggregation_operations.py@@ -10,7 +10,7 @@ from posthog.schema import DateRange, EventsNode, FunnelsFilter, FunnelsQueryfrom posthog.hogql import astfrom posthog.hogql.parser import parse_expr-from posthog.hogql_queries.insights.utils.aggregations import FirstTimeForUserDataWarehouseConfig+from posthog.hogql_queries.utils.aggregations import FirstTimeForUserDataWarehouseConfigfrom products.product_analytics.backend.hogql_queries.funnels.funnel_aggregation_operations import (FirstTimeForUserAggregationQuery,diff --git a/products/product_analytics/backend/hogql_queries/funnels/utils.py b/products/product_analytics/backend/hogql_queries/funnels/utils.pyindex cdc409816d45..b1ad0409d115 100644--- a/products/product_analytics/backend/hogql_queries/funnels/utils.py+++ b/products/product_analytics/backend/hogql_queries/funnels/utils.py@@ -16,7 +16,7 @@ from posthog.hogql.parser import parse_exprfrom posthog.hogql.property import apply_path_cleaningfrom posthog.constants import FUNNEL_WINDOW_INTERVAL_TYPES-from posthog.hogql_queries.insights.utils.breakdowns import ALL_USERS_COHORT_ID, NOT_IN_COHORT_ID+from posthog.hogql_queries.utils.breakdowns import ALL_USERS_COHORT_ID, NOT_IN_COHORT_IDfrom posthog.models.team.team import Teamfrom posthog.types import FunnelEntityNode, FunnelExclusionEntityNodefrom posthog.utils import DATERANGE_MAPdiff --git a/products/product_analytics/backend/hogql_queries/lifecycle/lifecycle_validation_rules.py b/products/product_analytics/backend/hogql_queries/lifecycle/lifecycle_validation_rules.pyindex 0adb78e896e8..700d61337a56 100644--- a/products/product_analytics/backend/hogql_queries/lifecycle/lifecycle_validation_rules.py+++ b/products/product_analytics/backend/hogql_queries/lifecycle/lifecycle_validation_rules.py@@ -2,7 +2,7 @@ from rest_framework.exceptions import ValidationErrorfrom posthog.schema import LifecycleQuery-from posthog.hogql_queries.insights.utils.entities import has_data_warehouse_node+from posthog.hogql_queries.utils.entities import has_data_warehouse_nodefrom posthog.hogql_queries.validation.validation import QueryValidationContextdiff --git a/products/product_analytics/backend/hogql_queries/paths/paths_query_runner.py b/products/product_analytics/backend/hogql_queries/paths/paths_query_runner.pyindex b59b1c2cde02..ec5ca15e2c93 100644--- a/products/product_analytics/backend/hogql_queries/paths/paths_query_runner.py+++ b/products/product_analytics/backend/hogql_queries/paths/paths_query_runner.py@@ -232,7 +232,7 @@ class PathsQueryRunner(AnalyticsQueryRunner[PathsQueryResponse]):if not self.query.funnelPathsFilter:raise ValueError("Funnel paths filter is required for funnel paths.")- from posthog.hogql_queries.insights.insight_actors_query_runner import InsightActorsQueryRunner+ from posthog.hogql_queries.insight_actors_query_runner import InsightActorsQueryRunnerfunnelPathType, funnelSource, funnelStep = (self.query.funnelPathsFilter.funnelPathType,diff --git a/products/product_analytics/backend/hogql_queries/paths_v2/test/test_paths_v2_actors.py b/products/product_analytics/backend/hogql_queries/paths_v2/test/test_paths_v2_actors.pyindex 7569109c67a5..56da65d759df 100644--- a/products/product_analytics/backend/hogql_queries/paths_v2/test/test_paths_v2_actors.py+++ b/products/product_analytics/backend/hogql_queries/paths_v2/test/test_paths_v2_actors.py@@ -23,7 +23,7 @@ from posthog.schema import ()from posthog.hogql_queries.actors_query_runner import ActorsQueryRunner-from posthog.hogql_queries.insights.insight_actors_query_runner import InsightActorsQueryRunner+from posthog.hogql_queries.insight_actors_query_runner import InsightActorsQueryRunnerfrom posthog.models.person import Personfrom posthog.test.test_journeys import journeys_fordiff --git a/products/product_analytics/backend/hogql_queries/retention/retention_base_query_fixed.py b/products/product_analytics/backend/hogql_queries/retention/retention_base_query_fixed.pyindex c2a28a126e45..b51ca78bfe11 100644--- a/products/product_analytics/backend/hogql_queries/retention/retention_base_query_fixed.py+++ b/products/product_analytics/backend/hogql_queries/retention/retention_base_query_fixed.py@@ -7,7 +7,7 @@ from posthog.hogql.parser import parse_exprfrom posthog.hogql.property import property_to_exprfrom posthog.dataclasses import frozen-from posthog.hogql_queries.insights.utils.breakdowns import ALL_USERS_COHORT_ID, has_breakdown_filter+from posthog.hogql_queries.utils.breakdowns import ALL_USERS_COHORT_ID, has_breakdown_filterfrom products.product_analytics.backend.hogql_queries.retention.retention_base_query_builder import (RetentionBaseQueryBuilder,diff --git a/products/product_analytics/backend/hogql_queries/retention/retention_query_runner.py b/products/product_analytics/backend/hogql_queries/retention/retention_query_runner.pyindex 503f0697672e..77fb9b2a516a 100644--- a/products/product_analytics/backend/hogql_queries/retention/retention_query_runner.py+++ b/products/product_analytics/backend/hogql_queries/retention/retention_query_runner.py@@ -33,14 +33,14 @@ from posthog.hogql.query import execute_hogql_queryfrom posthog.hogql.timings import HogQLTimingsfrom posthog.caching.insights_api import BASE_MINIMUM_INSIGHT_REFRESH_INTERVAL, REDUCED_MINIMUM_INSIGHT_REFRESH_INTERVAL-from posthog.hogql_queries.insights.utils.breakdowns import (+from posthog.hogql_queries.query_runner import AnalyticsQueryRunner+from posthog.hogql_queries.utils.breakdowns import (ALL_USERS_COHORT_ID,BREAKDOWN_OTHER_STRING_LABEL,has_breakdown_filter,has_single_breakdown,)-from posthog.hogql_queries.insights.utils.properties import has_cohort_property-from posthog.hogql_queries.query_runner import AnalyticsQueryRunner+from posthog.hogql_queries.utils.properties import has_cohort_propertyfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangeWithIntervalsfrom posthog.hogql_queries.validation.rules import DisallowUnsupportedDataWarehouseSettingsfrom posthog.hogql_queries.validation.validation import QueryValidationRulediff --git a/products/product_analytics/backend/hogql_queries/retention/retention_validation_rules.py b/products/product_analytics/backend/hogql_queries/retention/retention_validation_rules.pyindex fe420a6fd45d..6cd2e30f6b8d 100644--- a/products/product_analytics/backend/hogql_queries/retention/retention_validation_rules.py+++ b/products/product_analytics/backend/hogql_queries/retention/retention_validation_rules.py@@ -5,8 +5,8 @@ from posthog.schema import AggregationType, EntityType, RetentionQueryfrom posthog.hogql.database.database import Databasefrom posthog.hogql.database.models import DateDatabaseField, DateTimeDatabaseField-from posthog.hogql_queries.insights.utils.breakdowns import has_breakdown_filter-from posthog.hogql_queries.insights.utils.data_warehouse_schema_mixin import resolve_warehouse_field+from posthog.hogql_queries.utils.breakdowns import has_breakdown_filter+from posthog.hogql_queries.utils.data_warehouse_schema_mixin import resolve_warehouse_fieldfrom posthog.hogql_queries.validation.validation import QueryValidationContextdiff --git a/products/product_analytics/backend/hogql_queries/retention/test/test_retention_query_runner.py b/products/product_analytics/backend/hogql_queries/retention/test/test_retention_query_runner.pyindex 4d34618d927b..348eedbf2027 100644--- a/products/product_analytics/backend/hogql_queries/retention/test/test_retention_query_runner.py+++ b/products/product_analytics/backend/hogql_queries/retention/test/test_retention_query_runner.py@@ -36,7 +36,7 @@ from posthog.constants import (TREND_FILTER_TYPE_EVENTS,)from posthog.hogql_queries.actors_query_runner import ActorsQueryRunner-from posthog.hogql_queries.insights.utils.breakdowns import ALL_USERS_COHORT_ID, BREAKDOWN_OTHER_STRING_LABEL+from posthog.hogql_queries.utils.breakdowns import ALL_USERS_COHORT_ID, BREAKDOWN_OTHER_STRING_LABELfrom posthog.models.group.util import create_groupfrom posthog.settings import HOGQL_INCREASED_MAX_EXECUTION_TIMEfrom posthog.test.persons import create_person, update_persondiff --git a/products/product_analytics/backend/hogql_queries/retention/utils.py b/products/product_analytics/backend/hogql_queries/retention/utils.pyindex e63dc267cc15..0320e051bb0f 100644--- a/products/product_analytics/backend/hogql_queries/retention/utils.py+++ b/products/product_analytics/backend/hogql_queries/retention/utils.py@@ -4,7 +4,7 @@ from posthog.hogql import astfrom posthog.hogql.parser import parse_exprfrom posthog.clickhouse.query_tagging import tag_contains_user_hogql-from posthog.hogql_queries.insights.utils.breakdowns import strip_user_aliases+from posthog.hogql_queries.utils.breakdowns import strip_user_aliasesdef breakdown_extract_expr(property_name: str, breakdown_type: str, group_type_index: int | None = None) -> ast.Expr:diff --git a/products/product_analytics/backend/hogql_queries/stickiness/stickiness_query_runner.py b/products/product_analytics/backend/hogql_queries/stickiness/stickiness_query_runner.pyindex 5e6230ebc2ce..76552cea9116 100644--- a/products/product_analytics/backend/hogql_queries/stickiness/stickiness_query_runner.py+++ b/products/product_analytics/backend/hogql_queries/stickiness/stickiness_query_runner.py@@ -26,11 +26,11 @@ from posthog.hogql.query import execute_hogql_queryfrom posthog.hogql.timings import HogQLTimingsfrom posthog.caching.insights_api import BASE_MINIMUM_INSIGHT_REFRESH_INTERVAL, REDUCED_MINIMUM_INSIGHT_REFRESH_INTERVAL-from posthog.hogql_queries.insights.utils.utils import get_response_hogqlfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerfrom posthog.hogql_queries.utils.query_compare_to_date_range import QueryCompareToDateRangefrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.hogql_queries.utils.query_previous_period_date_range import QueryPreviousPeriodDateRange+from posthog.hogql_queries.utils.utils import get_response_hogqlfrom posthog.hogql_queries.validation.rules import DisallowUnsupportedDataWarehouseSettings, RequireAtLeastOneSeriesfrom posthog.hogql_queries.validation.validation import QueryValidationRulefrom posthog.models import Teamdiff --git a/products/surveys/backend/responses/fetch_rows.py b/products/surveys/backend/responses/fetch_rows.pyindex d7165db7ab93..2318f9fc49e0 100644--- a/products/surveys/backend/responses/fetch_rows.py+++ b/products/surveys/backend/responses/fetch_rows.py@@ -13,7 +13,7 @@ from typing import Any, castfrom posthog.hogql import astfrom posthog.hogql.parser import parse_expr, parse_select-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models import Teamfrom products.surveys.backend.models import Surveydiff --git a/products/surveys/backend/summarization/fetch.py b/products/surveys/backend/summarization/fetch.pyindex 53709c91e446..cc4c1a429041 100644--- a/products/surveys/backend/summarization/fetch.py+++ b/products/surveys/backend/summarization/fetch.py@@ -6,7 +6,7 @@ from typing import castfrom posthog.hogql import astfrom posthog.hogql.parser import parse_expr, parse_select-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models import Teamfrom products.surveys.backend.responses.fetch_rows import SUBMISSION_GROUPING_KEYdiff --git a/products/tracing/backend/logic.py b/products/tracing/backend/logic.pyindex 750e7c0bef1e..20b645aea351 100644--- a/products/tracing/backend/logic.py+++ b/products/tracing/backend/logic.py@@ -40,7 +40,7 @@ from posthog.hogql.property import property_to_exprfrom posthog.hogql.query import execute_hogql_queryfrom posthog.clickhouse.client.connection import Workload-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunner, ExecutionMode, QueryRunnerfrom posthog.hogql_queries.utils.query_date_range import QueryDateRangefrom posthog.models.filters.mixins.utils import cached_propertydiff --git a/products/web_analytics/backend/hogql_queries/external_clicks.py b/products/web_analytics/backend/hogql_queries/external_clicks.pyindex 442461b2797b..01ac4f9931b7 100644--- a/products/web_analytics/backend/hogql_queries/external_clicks.py+++ b/products/web_analytics/backend/hogql_queries/external_clicks.py@@ -14,7 +14,7 @@ from posthog.hogql import astfrom posthog.hogql.constants import LimitContextfrom posthog.hogql.parser import parse_select-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom products.web_analytics.backend.hogql_queries.web_analytics_query_runner import WebAnalyticsQueryRunnerdiff --git a/products/web_analytics/backend/hogql_queries/session_attribution_explorer_query_runner.py b/products/web_analytics/backend/hogql_queries/session_attribution_explorer_query_runner.pyindex 21c935978d42..d409769ecb8f 100644--- a/products/web_analytics/backend/hogql_queries/session_attribution_explorer_query_runner.py+++ b/products/web_analytics/backend/hogql_queries/session_attribution_explorer_query_runner.py@@ -11,7 +11,7 @@ from posthog.hogql import astfrom posthog.hogql.constants import LimitContextfrom posthog.hogql.parser import parse_select-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.hogql_queries.query_runner import AnalyticsQueryRunnerAD_IDS_PREFIXES_SESSIONS_V1 = [diff --git a/products/web_analytics/backend/hogql_queries/stats_table.py b/products/web_analytics/backend/hogql_queries/stats_table.pyindex 2c11da1325bf..f5feb1ebebdc 100644--- a/products/web_analytics/backend/hogql_queries/stats_table.py+++ b/products/web_analytics/backend/hogql_queries/stats_table.py@@ -29,7 +29,7 @@ from posthog.hogql.property import (from posthog.hogql.visitor import TraversingVisitorfrom posthog.clickhouse.query_tagging import clear_tag, get_query_tag_value-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models.filters.mixins.utils import cached_propertyfrom products.web_analytics.backend.hogql_queries.first_pageview_attribution import (diff --git a/products/web_analytics/backend/hogql_queries/web_agent_analytics.py b/products/web_analytics/backend/hogql_queries/web_agent_analytics.pyindex 00c77dfc100a..1d8a4546d629 100644--- a/products/web_analytics/backend/hogql_queries/web_agent_analytics.py+++ b/products/web_analytics/backend/hogql_queries/web_agent_analytics.py@@ -15,7 +15,7 @@ from posthog.hogql.errors import QueryErrorfrom posthog.hogql.parser import parse_expr, parse_selectfrom posthog.hogql.query import execute_hogql_query-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom posthog.models.filters.mixins.utils import cached_propertyfrom products.web_analytics.backend.hogql_queries.agent_analytics_definitions import (diff --git a/products/web_analytics/backend/hogql_queries/web_bots.py b/products/web_analytics/backend/hogql_queries/web_bots.pyindex 698bace1291c..ea137d75a007 100644--- a/products/web_analytics/backend/hogql_queries/web_bots.py+++ b/products/web_analytics/backend/hogql_queries/web_bots.py@@ -10,7 +10,7 @@ from posthog.hogql.constants import LimitContextfrom posthog.hogql.parser import parse_selectfrom posthog.hogql.property import property_to_expr-from posthog.hogql_queries.insights.paginators import HogQLHasMorePaginator+from posthog.hogql_queries.paginators import HogQLHasMorePaginatorfrom products.web_analytics.backend.hogql_queries.web_analytics_query_runner import WebAnalyticsQueryRunner