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

Commit

Permalink
Merge pull request #27 from socialpoint-labs/feature/isolation-config…
Browse files Browse the repository at this point in the history
…-extension

Add isolation configuration extension by connection variables
  • Loading branch information
philippe2803 authored Aug 26, 2020
2 parents b5e8d2a + 01ca157 commit 5f1c23f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sqlbucket/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


__version__ = "0.4.0"
__version__ = "0.4.1"


from sqlbucket.core import SQLBucket
Expand Down
11 changes: 8 additions & 3 deletions sqlbucket/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ def run_job(sqlbucket, name, db, fstep, tstep, to_date, from_date,
logger.info('Variables used')
logger.info(submitted_variables)

if isolation:
isolation = isolation.upper()

# included dbs
dbs = list()
if db:
dbs = db.split(',')
elif all:
Expand All @@ -72,6 +70,10 @@ def run_job(sqlbucket, name, db, fstep, tstep, to_date, from_date,
dbs = [item for item in dbs if item not in ex_dbs]

for dbi in dbs:
connection_variables = sqlbucket.connection_variables[dbi]
if 'isolation_level' in connection_variables and isolation is None:
isolation = connection_variables['isolation_level']

etl = sqlbucket.load_project(
project_name=name,
connection_name=dbi,
Expand All @@ -80,6 +82,9 @@ def run_job(sqlbucket, name, db, fstep, tstep, to_date, from_date,
if rendering:
etl.render(from_step=fstep, to_step=tstep, group=group)
else:
if isolation:
isolation = isolation.upper()

etl.run(
from_step=fstep,
to_step=tstep,
Expand Down

0 comments on commit 5f1c23f

Please sign in to comment.