diff --git a/target_postgres/connector.py b/target_postgres/connector.py index d6730539..3bc34e87 100644 --- a/target_postgres/connector.py +++ b/target_postgres/connector.py @@ -799,6 +799,13 @@ def column_exists( # type: ignore[override] schema_name=schema_name, table_name=table_name, connection=connection ) + def __del__(self): + """ + Dispose underlying SQLAlchemy engine object. + """ + if self._cached_engine is not None: + self._cached_engine.dispose() + class NOTYPE(TypeDecorator): """Type to use when none is provided in the schema."""