File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -180,8 +180,10 @@ def copy_table_structure(
180180
181181 @contextmanager
182182 def _connect (self ) -> t .Iterator [sqlalchemy .engine .Connection ]:
183- with self ._engine .connect ().execution_options () as conn :
183+ engine = self ._engine
184+ with engine .connect ().execution_options () as conn :
184185 yield conn
186+ engine .dispose ()
185187
186188 def drop_table (
187189 self , table : sqlalchemy .Table , connection : sqlalchemy .engine .Connection
@@ -800,9 +802,7 @@ def column_exists( # type: ignore[override]
800802 )
801803
802804 def __del__ (self ):
803- """
804- Dispose underlying SQLAlchemy engine object.
805- """
805+ """Dispose underlying SQLAlchemy engine object."""
806806 if self ._cached_engine is not None :
807807 self ._cached_engine .dispose ()
808808
You can’t perform that action at this time.
0 commit comments