Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit d05de0f

Browse files
author
Sung Won Chung
committed
Revert "resync"
This reverts commit af36b66.
1 parent af36b66 commit d05de0f

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

data_diff/databases/base.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -922,12 +922,6 @@ class Database(abc.ABC):
922922
is_closed: bool = False
923923
_dialect: BaseDialect = None
924924

925-
def __enter__(self):
926-
return self
927-
928-
def __exit__(self, exc_type, exc_value, traceback):
929-
self.close()
930-
931925
@property
932926
def name(self):
933927
return type(self).__name__
@@ -1170,8 +1164,9 @@ def _query_conn(self, conn, sql_code: Union[str, ThreadLocalInterpreter]) -> Que
11701164
return apply_query(callback, sql_code)
11711165

11721166
def close(self):
1173-
"""Close connection(s) to the database instance. Querying will stop functioning."""
1167+
"Close connection(s) to the database instance. Querying will stop functioning."
11741168
self.is_closed = True
1169+
return super().close()
11751170

11761171
@property
11771172
def dialect(self) -> BaseDialect:
@@ -1242,8 +1237,6 @@ def create_connection(self):
12421237
def close(self):
12431238
super().close()
12441239
self._queue.shutdown()
1245-
if hasattr(self.thread_local, "conn"):
1246-
self.thread_local.conn.close()
12471240

12481241
@property
12491242
def is_autocommit(self) -> bool:
@@ -1270,4 +1263,4 @@ def is_autocommit(self) -> bool:
12701263
DEFAULT_DATETIME_PRECISION = 6
12711264
DEFAULT_NUMERIC_PRECISION = 24
12721265

1273-
TIMESTAMP_PRECISION_POS = 20 # len("2022-06-03 12:24:35.") == 20
1266+
TIMESTAMP_PRECISION_POS = 20 # len("2022-06-03 12:24:35.") == 20

0 commit comments

Comments
 (0)