Skip to content
Snippets Groups Projects
Commit 2c9cdc0b authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

ENH: allow to set datatype when using assure_has_property

parent 85bc5783
No related branches found
No related tags found
No related merge requests found
......@@ -299,7 +299,7 @@ def assure_has_parent(entity, parent, to_be_updated=None, verbosity=INFO):
def assure_has_property(entity, name, value, to_be_updated=None,
verbosity=INFO):
verbosity=INFO, datatype=None):
"""
Checks whether `entity` has a property `name` with the value `value`.
......@@ -332,7 +332,11 @@ def assure_has_property(entity, name, value, to_be_updated=None,
name,
value, entity.id))
print("/"*60)
entity.add_property(name=name, value=value)
if datatype is None:
entity.add_property(name=name, value=value)
else:
entity.add_property(name=name, value=value, datatype=datatype)
if to_be_updated is None:
get_ids_for_entities_with_names([entity])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment