Skip to content

Commit d9af47d

Browse files
author
cpio
committed
Remove assert in modify method and raise ValueError instead
1 parent 16a9fe9 commit d9af47d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/dataregistry/registrar/base_table_class.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ def modify(self, entry_id, modify_fields):
104104
Dict where key is the column to modify (must be allowed to modify)
105105
and value is the desired new value for the entry
106106
"""
107-
assert (
108-
type(modify_fields) == dict
109-
), f"modify_fields is expected as a dict, {'column': new_values}"
107+
if (type(modify_fields) is not dict):
108+
raise ValueError(f"modify_fields is expected as a dict, {'column': new_values}")
110109

111110
# First make sure the given entry is in the registry
112111
previous_entry = self.find_entry(entry_id, raise_if_not_found=True)

0 commit comments

Comments
 (0)