"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "e70138bbe42f93d44fbf8c4704fbbde1cd1fdbc9"
Unverified Commit 7ff2662b authored by Mufei Li's avatar Mufei Li Committed by GitHub
Browse files

[Fix] Better Error Message for node_type_subgraph (#2554)

* Update

* Update

* Update
parent 9d90faf0
...@@ -543,6 +543,8 @@ def node_type_subgraph(graph, ntypes): ...@@ -543,6 +543,8 @@ def node_type_subgraph(graph, ntypes):
for stid, dtid, etid in zip(stids, dtids, etids): for stid, dtid, etid in zip(stids, dtids, etids):
if stid in ntid and dtid in ntid: if stid in ntid and dtid in ntid:
etypes.append(graph.canonical_etypes[etid]) etypes.append(graph.canonical_etypes[etid])
if len(etypes) == 0:
raise DGLError('There are no edges among nodes of the specified types.')
return edge_type_subgraph(graph, etypes) return edge_type_subgraph(graph, etypes)
DGLHeteroGraph.node_type_subgraph = utils.alias_func(node_type_subgraph) DGLHeteroGraph.node_type_subgraph = utils.alias_func(node_type_subgraph)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment