Skip to content

Commit

Permalink
reset clickhouse sqlalchemy engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Jul 13, 2022
1 parent ff44df7 commit fdeb59c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/logictest/clickhouse_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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))

Expand Down

0 comments on commit fdeb59c

Please sign in to comment.