Skip to content
Snippets Groups Projects
Commit 2e7cdaa5 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

DOC: a new docstring in sync_graph

parent f588cf86
No related branches found
No related tags found
2 merge requests!178FIX: #96 Better error output for crawl.py script.,!167Sync Graph
Pipeline #51244 failed
...@@ -340,6 +340,8 @@ class SyncGraph(): ...@@ -340,6 +340,8 @@ class SyncGraph():
def _sanity_check(entities: list[db.Entity]): def _sanity_check(entities: list[db.Entity]):
""" """
Checks whether each record in entities has at least one parent. Checks whether each record in entities has at least one parent.
Last review by Alexander Schlemmer on 2024-05-24.
""" """
for ent in entities: for ent in entities:
if ent.role == "Record" and len(ent.parents) == 0: if ent.role == "Record" and len(ent.parents) == 0:
...@@ -573,6 +575,15 @@ class SyncGraph(): ...@@ -573,6 +575,15 @@ class SyncGraph():
self._set_identifiable_of_node(other_node) self._set_identifiable_of_node(other_node)
def _identifiable_is_needed(self, node: SyncNode): def _identifiable_is_needed(self, node: SyncNode):
"""
This function checks:
- the identifiable of node is None
- the node has all properties that are needed for the identifiable
- there are no unchecked entities that are needed for the identifiable of the node,
neither as forward or as backward references
Last review by Alexander Schlemmer on 2024-05-24.
"""
return (node.identifiable is None and not self._identity_relies_on_unchecked_entity(node) return (node.identifiable is None and not self._identity_relies_on_unchecked_entity(node)
and self.identifiableAdapter.check_identifying_props(node, raise_exception=False)) and self.identifiableAdapter.check_identifying_props(node, raise_exception=False))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment