File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ def topo_sort(graph):
42
42
if (master := extract_master (part )) in graph :
43
43
for edge in graph .in_edges (part ):
44
44
parent = edge [0 ]
45
- if parent != master and extract_master (parent ) != master :
45
+ if master not in (parent , extract_master (parent )):
46
+ # if parent is neither master nor part of master
46
47
graph .add_edge (parent , master )
47
48
sorted_nodes = list (nx .topological_sort (graph ))
48
49
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ class Diagram(nx.DiGraph):
61
61
draws the diagram using pyplot
62
62
63
63
diag1 + diag2 - combines the two diagrams.
64
- diag1 - diag2 - differente between diagrams
65
- diag1 * diag2 - intersction of diagrams
64
+ diag1 - diag2 - difference between diagrams
65
+ diag1 * diag2 - intersection of diagrams
66
66
diag + n - expands n levels of successors
67
67
diag - n - expands n levels of predecessors
68
68
Thus dj.Diagram(schema.Table)+1-1 defines the diagram of immediate ancestors and descendants of schema.Table
@@ -71,7 +71,7 @@ class Diagram(nx.DiGraph):
71
71
Only those tables that are loaded in the connection object are displayed
72
72
"""
73
73
74
- def __init__ (self , source = None , context = None ):
74
+ def __init__ (self , source , context = None ):
75
75
76
76
if isinstance (source , Diagram ):
77
77
# copy constructor
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ class _AliasNode:
257
257
258
258
259
259
def _get_tier (table_name ):
260
- """given the table name, return"""
260
+ """given the table name, return the use table class. """
261
261
if not table_name .startswith ("`" ):
262
262
return _AliasNode
263
263
else :
You can’t perform that action at this time.
0 commit comments