From b9099ec2ceba196daae09caa3ed91744b016cde9 Mon Sep 17 00:00:00 2001 From: Eric Duong Date: Mon, 23 Dec 2024 14:23:00 -0500 Subject: [PATCH] chore(import-v2): enable v2 sql for allowlist (#27136) --- .../data_imports/workflow_activities/import_data_sync.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/posthog/temporal/data_imports/workflow_activities/import_data_sync.py b/posthog/temporal/data_imports/workflow_activities/import_data_sync.py index 0c51c8db81fcf..2e53da704554a 100644 --- a/posthog/temporal/data_imports/workflow_activities/import_data_sync.py +++ b/posthog/temporal/data_imports/workflow_activities/import_data_sync.py @@ -17,7 +17,7 @@ from posthog.temporal.data_imports.pipelines.pipeline.pipeline import PipelineNonDLT from posthog.temporal.data_imports.pipelines.pipeline_sync import DataImportPipelineSync, PipelineInputs -from posthog.temporal.data_imports.util import is_posthog_team +from posthog.temporal.data_imports.util import is_posthog_team, is_enabled_for_team from posthog.warehouse.models import ( ExternalDataJob, ExternalDataSource, @@ -164,7 +164,9 @@ def import_data_activity_sync(inputs: ImportDataActivityInputs): ExternalDataSource.Type.MYSQL, ExternalDataSource.Type.MSSQL, ]: - if is_posthog_team(inputs.team_id): + if is_posthog_team(inputs.team_id) or ( + settings.TEMPORAL_TASK_QUEUE == DATA_WAREHOUSE_TASK_QUEUE_V2 and is_enabled_for_team(inputs.team_id) + ): from posthog.temporal.data_imports.pipelines.sql_database_v2 import sql_source_for_type else: from posthog.temporal.data_imports.pipelines.sql_database import sql_source_for_type