feat: Fix bug in dedupe_node_list function (#137)
The code changes fix a bug in the `dedupe_node_list` function where a node instance was not found in the node map. The bug is now handled by logging a warning message and skipping the iteration. This ensures that the function continues to execute without any errors.
This commit is contained in:
parent
6d065d363a
commit
32b51530ec
1 changed files with 6 additions and 3 deletions
|
|
@ -272,9 +272,12 @@ async def dedupe_node_list(
|
||||||
unique_nodes = []
|
unique_nodes = []
|
||||||
uuid_map: dict[str, str] = {}
|
uuid_map: dict[str, str] = {}
|
||||||
for node_data in nodes_data:
|
for node_data in nodes_data:
|
||||||
node = node_map[node_data['uuids'][0]]
|
node_instance: EntityNode | None = node_map.get(node_data['uuids'][0])
|
||||||
node.summary = node_data['summary']
|
if node_instance is None:
|
||||||
unique_nodes.append(node)
|
logger.warning(f'Node {node_data["uuids"][0]} not found in node map')
|
||||||
|
continue
|
||||||
|
node_instance.summary = node_data['summary']
|
||||||
|
unique_nodes.append(node_instance)
|
||||||
|
|
||||||
for uuid in node_data['uuids'][1:]:
|
for uuid in node_data['uuids'][1:]:
|
||||||
uuid_value = node_map[node_data['uuids'][0]].uuid
|
uuid_value = node_map[node_data['uuids'][0]].uuid
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue