From 0c6f1e8ab75477a7dc8429f61d5c04bc87ff9f90 Mon Sep 17 00:00:00 2001 From: andyoneal Date: Wed, 13 Sep 2023 00:20:47 -0500 Subject: [PATCH] missing begin statements --- singer_sdk/connectors/sql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/singer_sdk/connectors/sql.py b/singer_sdk/connectors/sql.py index fb49b3587..8654a4074 100644 --- a/singer_sdk/connectors/sql.py +++ b/singer_sdk/connectors/sql.py @@ -659,7 +659,7 @@ def create_schema(self, schema_name: str) -> None: Args: schema_name: The target schema to create. """ - with self._connect() as conn: + with self._connect() as conn, conn.begin(): conn.execute(sqlalchemy.schema.CreateSchema(schema_name)) def create_empty_table( @@ -830,7 +830,7 @@ def rename_column(self, full_table_name: str, old_name: str, new_name: str) -> N column_name=old_name, new_column_name=new_name, ) - with self._connect() as conn: + with self._connect() as conn, conn.begin(): conn.execute(column_rename_ddl) def merge_sql_types( @@ -1139,7 +1139,7 @@ def _adapt_column_type( column_name=column_name, column_type=compatible_sql_type, ) - with self._connect() as conn: + with self._connect() as conn, conn.begin(): conn.execute(alter_column_ddl) def serialize_json(self, obj: object) -> str: