Skip to content

Commit

Permalink
fix: add postgres schema name in create engine
Browse files Browse the repository at this point in the history
  • Loading branch information
datageek00 committed Aug 25, 2023
1 parent a0e71c5 commit 575f3ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion datachecks/integrations/databases/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ def connect(self) -> Any:
port=self.data_connection.get("port"),
database=self.data_connection.get("database"),
)
engine = create_engine(url)
schema = self.data_connection.get("schema")
engine = create_engine(
url,
connect_args={"options": f"-csearch_path={schema}"},
isolation_level="AUTOCOMMIT",
)
self.connection = engine.connect()
return self.connection
except Exception as e:
Expand Down

0 comments on commit 575f3ae

Please sign in to comment.