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

Commit

Permalink
'PostgreSQL' object has no attribute '_conn'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlawin committed Oct 3, 2023
1 parent 943d128 commit 8f8cdf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data_diff/databases/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ def create_connection(self):

pg = import_postgresql()
try:
c = pg.connect(**self._args)
self._conn = pg.connect(**self._args)
if SESSION_TIME_ZONE:
c.cursor().execute(f"SET TIME ZONE '{SESSION_TIME_ZONE}'")
return c
self._conn.cursor().execute(f"SET TIME ZONE '{SESSION_TIME_ZONE}'")
return self._conn
except pg.OperationalError as e:
raise ConnectError(*e.args) from e

Expand Down

0 comments on commit 8f8cdf8

Please sign in to comment.