diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index 9642798bde69b36cf15d19b95ee20563e7117880..e069a911934e4cc86cddf2351e7fa0f52c80022a 100644 --- a/src/caoscrawler/crawl.py +++ b/src/caoscrawler/crawl.py @@ -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)