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

MAINT: rename and docstring"

"
parent 3674db5c
Branches
Tags
2 merge requests!160STY: styling,!140New f fix merge
Pipeline #46354 passed
......@@ -538,10 +538,16 @@ class Crawler(object):
return references
@staticmethod
def generate_merge_error_info(newrecord, record):
# Deal with two obvious cases where no merge will ever be possible:
def _treat_merge_error_of(newrecord, record):
"""
The parameters are two entities that cannot be merged with the merge_entities function.
# This function checks for two obvious cases where no merge will ever be possible:
# 1. Two Entities with differing IDs
# 2. Two non-Entity values which differ
It creates a more informative logger message and raises an Exception in those cases.
"""
for this_p in newrecord.properties:
that_p = record.get_property(this_p.name)
if (isinstance(this_p.value, db.Entity)
......@@ -643,7 +649,7 @@ class Crawler(object):
try:
merge_entities(newrecord, record, merge_references_with_empty_diffs=False)
except EntityMergeConflictError:
generate_merge_error_info(newrecord, record)
_treat_merge_error_of(newrecord, record)
# We cannot merge but it is none of the clear case where merge is
# impossible. Thus we try later
try_to_merge_later.append(record)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment