fix: adds back the ids to the nodes after node_link_graph
This commit is contained in:
parent
080143cdad
commit
f444ae21b4
1 changed files with 3 additions and 0 deletions
|
|
@ -274,6 +274,9 @@ class NetworkXAdapter(GraphDBInterface):
|
||||||
edge["updated_at"] = datetime.strptime(edge["updated_at"], "%Y-%m-%dT%H:%M:%S.%f%z")
|
edge["updated_at"] = datetime.strptime(edge["updated_at"], "%Y-%m-%dT%H:%M:%S.%f%z")
|
||||||
|
|
||||||
self.graph = nx.readwrite.json_graph.node_link_graph(graph_data)
|
self.graph = nx.readwrite.json_graph.node_link_graph(graph_data)
|
||||||
|
|
||||||
|
for node_id, node_data in self.graph.nodes(data=True):
|
||||||
|
node_data['id'] = node_id
|
||||||
else:
|
else:
|
||||||
# Log that the file does not exist and an empty graph is initialized
|
# Log that the file does not exist and an empty graph is initialized
|
||||||
logger.warning("File %s not found. Initializing an empty graph.", file_path)
|
logger.warning("File %s not found. Initializing an empty graph.", file_path)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue