diff --git a/posthog/warehouse/models/external_data_schema.py b/posthog/warehouse/models/external_data_schema.py index a4e91d45c577f..7659daab4a4e1 100644 --- a/posthog/warehouse/models/external_data_schema.py +++ b/posthog/warehouse/models/external_data_schema.py @@ -9,7 +9,6 @@ import uuid import psycopg2 import pymysql -import pymssql from .external_data_source import ExternalDataSource from posthog.warehouse.data_load.service import ( external_data_workflow_exists, @@ -358,6 +357,9 @@ def get_mssql_schemas( host: str, port: str, database: str, user: str, password: str, schema: str, ssh_tunnel: SSHTunnel ) -> dict[str, list[tuple[str, str]]]: def get_schemas(postgres_host: str, postgres_port: int): + # Importing pymssql requires mssql drivers to be installed locally + import pymssql + connection = pymssql.connect( server=postgres_host, port=str(postgres_port),