Skip to content

Commit d49339f

Browse files
sjanssen2antgonza
andauthored
Errhandling non dict values (#3463)
* Update CHANGELOG.md * test database contains command_parameters columns in qiita.processing_job with values "", which is not a dict and also not None --------- Co-authored-by: Antonio Gonzalez <[email protected]>
1 parent ba13403 commit d49339f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

qiita_db/software.py

+5
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,11 @@ def load(cls, command, json_str=None, values_dict=None):
16201620
error_msg = ("The provided JSON string doesn't encode a "
16211621
"parameter set for command %s" % command.id)
16221622
else:
1623+
if not isinstance(values_dict, dict):
1624+
raise qdb.exceptions.QiitaDBError(
1625+
"The provided value_dict is %s (i.e. not None) but also "
1626+
"not a dictionary for command %s" % (
1627+
values_dict, command.id))
16231628
parameters = deepcopy(values_dict)
16241629
error_msg = ("The provided values dictionary doesn't encode a "
16251630
"parameter set for command %s" % command.id)

0 commit comments

Comments
 (0)