Skip to content

Commit

Permalink
Remove as_dependency_list
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Beck committed Nov 28, 2018
1 parent 83aaa4e commit e04422d
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions dbt/linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,45 +171,6 @@ def as_graph_queue(self, manifest, limit_to=None):
)
return GraphQueue(new_graph, manifest)

def as_dependency_list(self, limit_to=None, ephemeral_only=False):
"""returns a list of list of nodes, eg. [[0,1], [2], [4,5,6]]. Each
element contains nodes whose dependenices are subsumed by the union of
all lists before it. In this way, all nodes in list `i` can be run
simultaneously assuming that all lists before list `i` have been
completed"""

depth_nodes = defaultdict(list)

if limit_to is None:
graph_nodes = self.graph.nodes()
else:
graph_nodes = limit_to

for node in graph_nodes:
if node not in self.graph:
raise RuntimeError(
"Couldn't find model '{}' -- does it exist or is "
"it disabled?".format(node)
)

num_ancestors = len([
ancestor for ancestor in
nx.ancestors(self.graph, node)
if (dbt.utils.is_blocking_dependency(
self.get_node(ancestor)) and
(ephemeral_only is False or
dbt.utils.get_materialization(
self.get_node(ancestor)) == 'ephemeral'))
])

depth_nodes[num_ancestors].append(node)

dependency_list = []
for depth in sorted(depth_nodes.keys()):
dependency_list.append(depth_nodes[depth])

return dependency_list

def get_dependent_nodes(self, node):
return nx.descendants(self.graph, node)

Expand Down

0 comments on commit e04422d

Please sign in to comment.