Skip to content
Snippets Groups Projects

F fix merge entity conflicts

Merged Florian Spreckelsen requested to merge f-fix-merge-entity-conflicts into dev
2 files
+ 13
7
Compare changes
  • Side-by-side
  • Inline

Files

+ 7
4
@@ -205,8 +205,9 @@ def compare_entities(old_entity: Entity, new_entity: Entity, compare_referenced_
value that is stored in the respective entity.
If `compare_referenced_records` is `True`, also referenced entities will be
compared using this function, but with `compare_referenced_records = False`
to prevent infinite recursion in case of circular references.
compared using this function (which is then called with
`compare_referenced_records = False` to prevent infinite recursion in case
of circular references).
Parameters
----------
@@ -215,7 +216,9 @@ def compare_entities(old_entity: Entity, new_entity: Entity, compare_referenced_
compare_referenced_records : bool, optional
Whether to compare referenced records in case of both, `old_entity` and
`new_entity`, have the same reference properties and both have a Record
object as value.
object as value. If set to `False`, only the corresponding Python
objects are compared which may lead to unexpected behavior when
identical records are stored in different objects. Default is False.
"""
olddiff: Dict[str, Any] = {"properties": {}, "parents": []}
@@ -269,7+272,7 @@
new_entity.get_importance(prop.name)):
olddiff["properties"][prop.name]["importance"] = \
old_entity.get_importance(prop.name)
newdiff["properties"][prop.name]["importance"] = \
new_entity.get_importance(prop.name)
if (prop.datatype != matching[0].datatype):
@@ -288,7+291,7 @@
if compare_referenced_records:
# scalar reference
if isinstance(prop.value, Entity) and isinstance(matching[0].value, Entity):
# exlicitely not recursive to prevent infinite recursion
# explicitely not recursive to prevent infinite recursion
same_value = empty_diff(
prop.value, matching[0].value, compare_referenced_records=False)
# list of references
Loading