diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..c53aac86a Binary files /dev/null and b/.DS_Store differ diff --git a/cognee/.DS_Store b/cognee/.DS_Store new file mode 100644 index 000000000..51227d71a Binary files /dev/null and b/cognee/.DS_Store differ diff --git a/cognee/infrastructure/databases/graph/networkx/adapter.py b/cognee/infrastructure/databases/graph/networkx/adapter.py index 65aeea289..a72376082 100644 --- a/cognee/infrastructure/databases/graph/networkx/adapter.py +++ b/cognee/infrastructure/databases/graph/networkx/adapter.py @@ -284,16 +284,10 @@ class NetworkXAdapter(GraphDBInterface): os.makedirs(file_dir, exist_ok = True) await self.save_graph_to_file(file_path) - except Exception as e: - logger.error("Failed to load graph from file: %s \n %s", file_path, str(e)) - # Initialize an empty graph in case of error - self.graph = nx.MultiDiGraph() - file_dir = os.path.dirname(file_path) - if not os.path.exists(file_dir): - os.makedirs(file_dir, exist_ok = True) + except Exception: + logger.error("Failed to load graph from file: %s", file_path) - await self.save_graph_to_file(file_path) async def delete_graph(self, file_path: str = None): """Asynchronously delete the graph file from the filesystem."""