Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidenissov-cog committed Jul 3, 2020
1 parent a89e9e4 commit 7c81627
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions studio/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .local_db_provider import LocalDbProvider
from .s3_provider import S3Provider
from .gs_provider import GSProvider
import model_setup
from model_setup import setup_model, get_model_db_provider
from . import logs

def get_config(config_file=None):
Expand Down Expand Up @@ -60,7 +60,7 @@ def replace_with_env(config):

def get_db_provider(config=None, blocking_auth=True):

db_provider = model_setup.get_db_provider()
db_provider = get_model_db_provider()
if not db_provider is None:
return db_provider

Expand Down Expand Up @@ -120,10 +120,10 @@ def get_db_provider(config=None, blocking_auth=True):
artifact_store = db_provider.get_artifact_store()

else:
model_setup._model_setup = None
_model_setup = None
raise ValueError('Unknown type of the database ' + db_config['type'])

model_setup.setup_model(db_provider, artifact_store)
setup_model(db_provider, artifact_store)
return db_provider

def parse_verbosity(verbosity=None):
Expand Down
4 changes: 2 additions & 2 deletions studio/model_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
def setup_model(db_provider, artifact_store):
_model_setup = { DB_KEY: db_provider, STORE_KEY: artifact_store }

def get_db_provider():
def get_model_db_provider():
if _model_setup is None:
return None
return _model_setup.get(DB_KEY, None)

def get_artifact_store():
def get_model_artifact_store():
if _model_setup is None:
return None
return _model_setup.get(STORE_KEY, None)

0 comments on commit 7c81627

Please sign in to comment.