Skip to content

Commit

Permalink
[#3988] Fix test deprecation warnings (#4556)
Browse files Browse the repository at this point in the history
automatic commit by git-black, original commits:
  5aeb088
  • Loading branch information
gshank authored and iknox-fa committed Feb 8, 2022
1 parent a09aaf4 commit 64fce5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/dbt/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def write_graph(self, outfile: str, manifest: Manifest):
for node_id in self.graph:
data = manifest.expect(node_id).to_dict(omit_none=True)
out_graph.add_node(node_id, **data)
with open(outfile, 'wb') as outfh:
with open(outfile, "wb") as outfh:
pickle.dump(out_graph, outfh, protocol=pickle.HIGHEST_PROTOCOL)


Expand Down
5 changes: 1 addition & 4 deletions core/dbt/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ def ancestors(
# This used to use nx.utils.reversed(self.graph), but that is deprecated,
# so changing to use self.graph.reverse(copy=False) as recommeneded
G = self.graph.reverse(copy=False) if self.graph.is_directed() else self.graph
anc = nx.single_source_shortest_path_length(G=G,
source=node,
cutoff=max_depth)\
.keys()
anc = nx.single_source_shortest_path_length(G=G, source=node, cutoff=max_depth).keys()
return anc - {node}

def descendants(
Expand Down

0 comments on commit 64fce5f

Please sign in to comment.