Skip to content

Commit 5ea8756

Browse files
authored
Merge pull request #66 from HYPERNETS/metadata_db
add check if db url is None
2 parents 5ee7f66 + b731364 commit 5ea8756

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

hypernets_processor/context.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ def __init__(self, processor_config=None, job_config=None, logger=None):
5353
db_fmts = DB_DICT_DEFS.keys()
5454
for db_fmt in db_fmts:
5555
if db_fmt + "_db_url" in self.get_config_names():
56-
setattr(
57-
self,
58-
db_fmt+"_db",
59-
open_database(self.get_config_value(db_fmt + "_db_url"), create_format=db_fmt)
60-
)
56+
if self.get_config_value(db_fmt + "_db_url") is not None:
57+
setattr(
58+
self,
59+
db_fmt+"_db",
60+
open_database(
61+
self.get_config_value(db_fmt + "_db_url"),
62+
create_format=db_fmt
63+
)
64+
)
6165

6266
def unpack_config(self, config, protected_values=None):
6367
"""

0 commit comments

Comments
 (0)