Skip to content

Commit

Permalink
Address issues
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Aug 8, 2023
1 parent 407733d commit 046044f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

if t.TYPE_CHECKING:
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.sql.elements import TextClause


class SQLConnector:
Expand Down Expand Up @@ -746,7 +747,7 @@ def prepare_schema(self, schema_name: str) -> None:
@staticmethod
def get_truncate_table_ddl(
table_name: str,
) -> tuple[text, dict]:
) -> tuple[TextClause, dict]:
"""Get the truncate table SQL statement.
Override this if your database uses a different syntax for truncating tables.
Expand Down Expand Up @@ -778,9 +779,8 @@ def truncate_table(self, full_table_name: str) -> None:
truncate_table_ddl, kwargs = self.get_truncate_table_ddl(
table_name=full_table_name,
)
with self._connect() as conn:
with self._connect() as conn, conn.begin():
conn.execute(truncate_table_ddl, **kwargs)
conn.commit()

def prepare_table(
self,
Expand Down

0 comments on commit 046044f

Please sign in to comment.