From 69f9ff17936f0ef369261d385448e6f2a17449bb Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 13 Jun 2024 15:21:45 +0200 Subject: [PATCH] add variables to .env-example --- .env-example | 6 ++++++ xexe/rate_writing.py | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.env-example b/.env-example index 22c1399..eb1f661 100644 --- a/.env-example +++ b/.env-example @@ -1,2 +1,8 @@ XE_ACCOUNT_ID= XE_API_KEY= + +DWH_HOST= +DWH_PORT= +DWH_DB= +DWH_USER= +DWH_PASSWORD= diff --git a/xexe/rate_writing.py b/xexe/rate_writing.py index 5589b68..fc82805 100644 --- a/xexe/rate_writing.py +++ b/xexe/rate_writing.py @@ -68,11 +68,8 @@ class DWHRateWriter(RateWriter): schema = DWH_SCHEMA table = DWH_TABLE + self.connection.autocommit = False try: - # Start a transaction - self.connection.autocommit = False - - # Check if schema exists cursor.execute( sql.SQL( "SELECT schema_name FROM information_schema.schemata WHERE schema_name = %s;" @@ -84,7 +81,6 @@ class DWHRateWriter(RateWriter): if not schema_exists: raise Exception(f"Schema '{schema}' does not exist.") - # Check if table exists cursor.execute( sql.SQL( "SELECT table_name FROM information_schema.tables WHERE table_schema = %s AND table_name = %s;"