Skip to content

Commit

Permalink
Fixes and optimization for getting db_provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidenissov-cog committed Jul 3, 2020
1 parent d6b22ec commit a89e9e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions studio/encrypted_payload_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,5 @@ def construct(self, experiment, config, packages):

print(json.dumps(encrypted_payload, indent=4))

exit(0)

return encrypted_payload

11 changes: 8 additions & 3 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
from .model_setup import setup_model
import model_setup
from . import logs

def get_config(config_file=None):
Expand Down Expand Up @@ -59,6 +59,11 @@ def replace_with_env(config):
.format(config_paths))

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

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

if not config:
config = get_config()
verbose = parse_verbosity(config.get('verbose'))
Expand Down Expand Up @@ -115,10 +120,10 @@ def get_db_provider(config=None, blocking_auth=True):
artifact_store = db_provider.get_artifact_store()

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

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

def parse_verbosity(verbosity=None):
Expand Down

0 comments on commit a89e9e4

Please sign in to comment.