From 977b460428384009befb199b1c2587b427b1d84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com> Date: Wed, 24 Jan 2024 14:55:43 +0100 Subject: [PATCH] MAINT: rename and docstring" " --- src/caoscrawler/crawl.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py index 9642798b..e069a911 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) -- GitLab