dmlc / dgl

Python package built to ease deep learning on graph, on top of existing DL frameworks.
http://dgl.ai
Apache License 2.0
13.41k stars 3k forks source link

[GraphBolt] FeatureFetcher throws exception if `input_nodes` does not contain target feature #7385

Closed Rhett-Ying closed 5 months ago

Rhett-Ying commented 5 months ago

🐛 Bug

https://github.com/dmlc/dgl/blob/2da713f8a90496ab73fe97acdb75f9e8a2b98704/python/dgl/graphbolt/feature_fetcher.py#L91-L92

If input_nodes does not contain any keys(node/edge types) that are listed in node/edge_feature_key, exception is thrown. Should we skip for such case?

Expected behavior

Skip non-existent feature keys.

Environment

Additional context

mfbalin commented 5 months ago

Should we fix this before DGL 2.2 release as well? Seems like a big problem for the users.

mfbalin commented 5 months ago

Isn't the fix simple adding a single if expression to check if input_nodes contains the key or not? If it doesn't, we can simply skip.