Skip to content

Commit 74dfe41

Browse files
Merge pull request #645 from guzman-raphael/dev
Fix diagram issue when node has no primary keys
2 parents bb21796 + c88784a commit 74dfe41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

datajoint/diagram.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ def _make_graph(self):
230230
# mark "distinguished" tables, i.e. those that introduce new primary key attributes
231231
for name in self.nodes_to_show:
232232
foreign_attributes = set(attr for p in self.in_edges(name, data=True) for attr in p[2]['attr_map'])
233-
self.node[name]['distinguished'] = foreign_attributes < self.node[name]['primary_key']
233+
self.node[name]['distinguished'] = ('primary_key' in self.node[name] and
234+
foreign_attributes < self.node[name]['primary_key'])
234235
# include aliased nodes that are sandwiched between two displayed nodes
235236
gaps = set(nx.algorithms.boundary.node_boundary(self, self.nodes_to_show)).intersection(
236237
nx.algorithms.boundary.node_boundary(nx.DiGraph(self).reverse(), self.nodes_to_show))

0 commit comments

Comments
 (0)