We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05cc023 commit c5fff51Copy full SHA for c5fff51
dvc/command/pipeline.py
@@ -61,7 +61,7 @@ def _build_graph(self, target, commands, outs):
61
for out in stage.outs:
62
edges.append((str(out), str(dep)))
63
else:
64
- for from_stage, to_stage in networkx.dfs_edges(G, target_stage):
+ for from_stage, to_stage in networkx.edge_dfs(G, target_stage):
65
if commands:
66
if to_stage.cmd is None:
67
continue
tests/func/test_pipeline.py
@@ -237,3 +237,29 @@ def locked_stage(self):
237
238
pipelines = self.dvc.pipelines
239
self.assertEqual(len(pipelines), 0)
240
+
241
242
+def test_split_pipeline(tmp_dir, dvc):
243
+ tmp_dir.dvc_gen("data", "source file content")
244
+ dvc.run(
245
+ deps=["data"],
246
+ outs=["data_train", "data_valid"],
247
+ cmd="echo train >> data_train && echo valid >> data_valid",
248
+ )
249
+ stage = dvc.run(
250
+ deps=["data_train", "data_valid"],
251
+ outs=["result"],
252
+ cmd="echo result >> result",
253
254
255
+ command = CmdPipelineShow([])
256
+ nodes, edges, is_tree = command._build_graph(
257
+ stage.path, commands=False, outs=True
258
259
+ assert set(nodes) == {"data", "data_train", "data_valid", "result"}
260
+ assert set(edges) == {
261
+ ("result", "data_train"),
262
+ ("result", "data_valid"),
263
+ ("data_train", "data"),
264
+ ("data_valid", "data"),
265
+ }
0 commit comments