You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within the get_node_type method in graph_tool.py there is an if-clause to check, if a certain key exists in graph.keys(), but if it fails, accessing the key is still tried and will fail with a KeyError:
defget_node_type(self, name):
ifnameinself.graph.keys() and"attr"inself.graph[name].keys(): # <-- Check if name is in keysreturnself.graph[name]["attr"]["type"]
else:
logging.info(name, self.graph[name]) # <-- Causes key errorreturnNone
Instead, something like that could be done:
logging.info(name, self.graph.get(name, "Name not in graph"))
I'm not sure if it is expected behavior that the name does not exist within the keys. If it's not, a different, more precise error message should be printed and an exception should be raised accordingly.
The text was updated successfully, but these errors were encountered:
Within the
get_node_type
method ingraph_tool.py
there is an if-clause to check, if a certain key exists ingraph.keys()
, but if it fails, accessing the key is still tried and will fail with aKeyError
:Instead, something like that could be done:
I'm not sure if it is expected behavior that the name does not exist within the keys. If it's not, a different, more precise error message should be printed and an exception should be raised accordingly.
The text was updated successfully, but these errors were encountered: