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

FIX: keyError when only one record has datatype, unit or value

parent 02ad8881
No related branches found
No related tags found
2 merge requests!71Release 0.9,!70F fix merge key word
Pipeline #28788 passed
......@@ -338,11 +338,14 @@ def merge_entities(entity_a: Entity, entity_b: Entity):
raise NotImplementedError()
for attribute in ("datatype", "unit", "value"):
if diff_r1["properties"][key][attribute] is None:
setattr(entity_a.get_property(key), attribute,
diff_r2["properties"][key][attribute])
else:
raise RuntimeError("Merge conflict.")
if (attribute in diff_r2["properties"][key] and
diff_r2["properties"][key][attribute] is not None):
print(diff_r2["properties"][key][attribute])
if (diff_r1["properties"][key][attribute] is None):
setattr(entity_a.get_property(key), attribute,
diff_r2["properties"][key][attribute])
else:
raise RuntimeError("Merge conflict.")
else:
# TODO: This is a temporary FIX for
# https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/105
......
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