: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
fix(hogql): Set team modifiers (#98366)
Tomás Farías Santanab6428fb4aa30
diff --git a/products/batch_exports/backend/hogql_source.py b/products/batch_exports/backend/hogql_source.pyindex dbdbd5553bef..4e73ba888587 100644--- a/products/batch_exports/backend/hogql_source.py+++ b/products/batch_exports/backend/hogql_source.py@@ -10,6 +10,7 @@ from posthog.hogql import astfrom posthog.hogql.context import HogQLContextfrom posthog.hogql.database.database import Databasefrom posthog.hogql.errors import ExposedHogQLError+from posthog.hogql.modifiers import create_default_modifiers_for_teamfrom posthog.hogql.parser import parse_selectfrom posthog.hogql.placeholders import find_placeholdersfrom posthog.hogql.printer import prepare_ast_for_printing@@ -64,6 +65,7 @@ def create_hogql_context_for_batch_export(team: "Team", values: dict[str, typingenable_select_queries=True,limit_top_select=False,values=values if values is not None else {},+ modifiers=create_default_modifiers_for_team(team),)context.database = Database.create_for(team=team, modifiers=context.modifiers)return context