Skip to content

Commit 993e3af

Browse files
committed
fix: use from_networkx if graph does not exist in db
1 parent e9a1658 commit 993e3af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nx_arangodb/convert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ def _to_nxcg_graph(G: Any, as_directed: bool = False) -> nxcg.Graph:
138138
return G
139139

140140
if isinstance(G, nxadb.Graph):
141+
logger.debug("converting nx_arangodb graph to nx_cugraph graph")
142+
141143
if not G.graph_exists_in_db:
142-
m = "nx_arangodb.Graph does not exist in ArangoDB. Cannot pull graph."
143-
raise ValueError(m)
144+
return nxcg.convert.from_networkx(G)
144145

145-
logger.debug("converting nx_arangodb graph to nx_cugraph graph")
146146
return nxadb_to_nxcg(G, as_directed=as_directed)
147147

148148
raise TypeError(f"Expected nx_arangodb.Graph or nxcg.Graph; got {type(G)}")

0 commit comments

Comments
 (0)