From fdeb59c041471e8d07bba3c8cbb2c20da6271cb9 Mon Sep 17 00:00:00 2001 From: Yang Xiufeng Date: Wed, 13 Jul 2022 11:13:00 +0800 Subject: [PATCH] reset clickhouse sqlalchemy engine. --- tests/logictest/clickhouse_connector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/logictest/clickhouse_connector.py b/tests/logictest/clickhouse_connector.py index 5e36d1c74532..77beffd97261 100644 --- a/tests/logictest/clickhouse_connector.py +++ b/tests/logictest/clickhouse_connector.py @@ -25,8 +25,7 @@ def connect(self, headers = e.dict("CLICKHOUSE_ADDITIONAL_HEADERS") for key in headers: self._additonal_headers["header__" + key] = headers[key] - self._engine = create_engine(self._uri, - connect_args=self._additonal_headers) + self._session = None def query_with_session(self, statement): @@ -45,7 +44,8 @@ def parseSQL(sql): return sql # do nothing if self._session is None: - self._session = make_session(self._engine) + engine = create_engine(self._uri, connect_args=self._additonal_headers) + self._session = make_session(engine) log.debug(parseSQL(statement)) return self._session.execute(parseSQL(statement))