diff --git a/posthog/hogql_queries/insights/funnels/base.py b/posthog/hogql_queries/insights/funnels/base.py index 330ad3bf804e7..18992e36c88cc 100644 --- a/posthog/hogql_queries/insights/funnels/base.py +++ b/posthog/hogql_queries/insights/funnels/base.py @@ -195,7 +195,7 @@ def _get_breakdown_expr(self) -> ast.Expr: elif breakdownType == "data_warehouse_person_property" and isinstance(breakdown, str): return ast.Field(chain=["person", *breakdown.split(".")]) else: - raise ExposedHogQLError(detail=f"Unsupported breakdown type: {breakdownType}") + raise ExposedHogQLError(f"Unsupported breakdown type: {breakdownType}") def _format_results( self, results diff --git a/posthog/hogql_queries/insights/funnels/test/test_funnel.py b/posthog/hogql_queries/insights/funnels/test/test_funnel.py index 77033100a5009..e8fbcadb6582f 100644 --- a/posthog/hogql_queries/insights/funnels/test/test_funnel.py +++ b/posthog/hogql_queries/insights/funnels/test/test_funnel.py @@ -9,6 +9,7 @@ from posthog.api.instance_settings import get_instance_setting from posthog.clickhouse.client.execute import sync_execute from posthog.constants import INSIGHT_FUNNELS, FunnelOrderType, FunnelVizType +from posthog.hogql.errors import ExposedHogQLError from posthog.hogql.modifiers import create_default_modifiers_for_team from posthog.hogql.query import execute_hogql_query from posthog.hogql_queries.actors_query_runner import ActorsQueryRunner @@ -1942,7 +1943,7 @@ def test_funnel_exclusions_invalid_params(self): ], } query = cast(FunnelsQuery, filter_to_query(filters)) - self.assertRaises(ValidationError, lambda: FunnelsQueryRunner(query=query, team=self.team).calculate()) + self.assertRaises(ExposedHogQLError, lambda: FunnelsQueryRunner(query=query, team=self.team).calculate()) def test_funnel_exclusion_no_end_event(self): filters = { diff --git a/posthog/hogql_queries/insights/funnels/test/test_funnel_correlation.py b/posthog/hogql_queries/insights/funnels/test/test_funnel_correlation.py index da85943dcd894..1fa091b76f9af 100644 --- a/posthog/hogql_queries/insights/funnels/test/test_funnel_correlation.py +++ b/posthog/hogql_queries/insights/funnels/test/test_funnel_correlation.py @@ -2,9 +2,9 @@ import unittest from freezegun import freeze_time -from rest_framework.exceptions import ValidationError from posthog.constants import INSIGHT_FUNNELS +from posthog.hogql.errors import ExposedHogQLError from posthog.hogql_queries.insights.funnels.funnel_correlation_query_runner import ( EventContingencyTable, EventStats, @@ -1189,14 +1189,14 @@ def test_correlation_with_properties_raises_validation_error(self): ) flush_persons_and_events() - with self.assertRaises(ValidationError): + with self.assertRaises(ExposedHogQLError): self._get_events_for_filters( filters, funnelCorrelationType=FunnelCorrelationResultsType.PROPERTIES, # funnelCorrelationNames=["$browser"] -- missing ) - with self.assertRaises(ValidationError): + with self.assertRaises(ExposedHogQLError): self._get_events_for_filters( filters, funnelCorrelationType=FunnelCorrelationResultsType.EVENT_WITH_PROPERTIES, diff --git a/posthog/hogql_queries/insights/funnels/test/test_funnel_unordered.py b/posthog/hogql_queries/insights/funnels/test/test_funnel_unordered.py index e7596024d8b83..54b4b3c0c7d1a 100644 --- a/posthog/hogql_queries/insights/funnels/test/test_funnel_unordered.py +++ b/posthog/hogql_queries/insights/funnels/test/test_funnel_unordered.py @@ -4,6 +4,7 @@ from rest_framework.exceptions import ValidationError from posthog.constants import INSIGHT_FUNNELS, FunnelOrderType +from posthog.hogql.errors import ExposedHogQLError from posthog.hogql_queries.insights.funnels.funnels_query_runner import FunnelsQueryRunner from posthog.hogql_queries.legacy_compatibility.filter_to_query import filter_to_query @@ -1147,7 +1148,7 @@ def test_funnel_exclusions_invalid_params(self): } query = cast(FunnelsQuery, filter_to_query(filters)) - self.assertRaises(ValidationError, lambda: FunnelsQueryRunner(query=query, team=self.team).calculate()) + self.assertRaises(ExposedHogQLError, lambda: FunnelsQueryRunner(query=query, team=self.team).calculate()) def test_funnel_exclusions_full_window(self): filters = {