From 8f8cdf81a5e111001c1cdbad987df1f38abe7b75 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 3 Oct 2023 10:38:34 -0600 Subject: [PATCH] 'PostgreSQL' object has no attribute '_conn' --- data_diff/databases/postgresql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data_diff/databases/postgresql.py b/data_diff/databases/postgresql.py index 2b044b36..996d7a4a 100644 --- a/data_diff/databases/postgresql.py +++ b/data_diff/databases/postgresql.py @@ -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