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

DOCS: add comments for clarification

parent 900cb2ba
No related branches found
No related tags found
1 merge request!182Draft: FIX: do not replace prop during merge
Pipeline #62420 canceled
......@@ -587,8 +587,10 @@ def merge_entities(entity_a: Entity,
raise NotImplementedError()
for attribute in ("datatype", "unit", "value"):
# attribute is in r2
if (attribute in diff_r2["properties"][key] and
diff_r2["properties"][key][attribute] is not None):
# but not in r1
if (attribute not in diff_r1["properties"][key] or
diff_r1["properties"][key][attribute] is None):
setattr(entity_a.get_property(key), attribute,
......@@ -596,6 +598,7 @@ def merge_entities(entity_a: Entity,
elif force:
setattr(entity_a.get_property(key), attribute,
diff_r2["properties"][key][attribute])
# attribute in r1 but no "force"
else:
raise_error = True
if merge_id_with_resolved_entity is True and attribute == "value":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment