From 49427abeb841f5a6b59dd9145a93e89bb205cf48 Mon Sep 17 00:00:00 2001 From: pattonw Date: Mon, 13 Nov 2023 15:25:07 -0800 Subject: [PATCH] fix typo: return an empty list --- funlib/persistence/graphs/sqlite_graph_provider.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/funlib/persistence/graphs/sqlite_graph_provider.py b/funlib/persistence/graphs/sqlite_graph_provider.py index 9783993..c696a85 100644 --- a/funlib/persistence/graphs/sqlite_graph_provider.py +++ b/funlib/persistence/graphs/sqlite_graph_provider.py @@ -282,7 +282,7 @@ def read_edges( nodes = self.read_nodes(roi) if len(nodes) == 0: - return [{}] + return [] node_ids = ", ".join([str(node["id"]) for node in nodes]) node_condition = f"u IN ({node_ids})" @@ -613,7 +613,10 @@ def get_graph( ) u, v = self.endpoint_names node_list = [(n["id"], self.__remove_keys(n, ["id"])) for n in nodes] - edge_list = [(e[u], e[v], self.__remove_keys(e, [u, v])) for e in edges] + try: + edge_list = [(e[u], e[v], self.__remove_keys(e, [u, v])) for e in edges] + except KeyError as e: + raise ValueError(edges[:5]) from e if self.directed: graph = SQLiteSubDiGraph(self, roi) else: