mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Improve OverlappingOutputsError exception message. (#5015)
* trie: updated message for OverlappingOutputsError the message given by the exception was not verbose enough why this exception is thrown. now gives the user more information as to why the overlapping paths should be changed. * test_run_single_stage: fixed test TestShouldRaiseOnOverlappingOutputPaths the test is now updated to reflect the exception message changes. Signed-off-by: metalglove <[email protected]>
This commit is contained in:
+4
-3
@@ -25,9 +25,10 @@ def build_outs_trie(stages):
|
||||
overlapping = out
|
||||
if parent and overlapping:
|
||||
msg = (
|
||||
"Paths for outs:\n'{}'('{}')\n'{}'('{}')\n"
|
||||
"overlap. To avoid unpredictable behaviour, "
|
||||
"rerun command with non overlapping outs paths."
|
||||
"The output paths:\n'{}'('{}')\n'{}'('{}')\n"
|
||||
"overlap and are thus in the same tracked directory.\n"
|
||||
"To keep reproducibility, outputs should be in separate "
|
||||
"tracked directories or tracked individually."
|
||||
).format(
|
||||
str(parent),
|
||||
parent.stage.addressing,
|
||||
|
||||
@@ -830,14 +830,15 @@ class TestShouldRaiseOnOverlappingOutputPaths(TestDvc):
|
||||
data_dir_stage = self.DATA_DIR + DVC_FILE_SUFFIX
|
||||
data_stage = os.path.basename(self.DATA) + DVC_FILE_SUFFIX
|
||||
|
||||
self.assertIn("Paths for outs:\n", error_output)
|
||||
self.assertIn("The output paths:\n", error_output)
|
||||
self.assertIn(
|
||||
f"\n'{self.DATA_DIR}'('{data_dir_stage}')\n", error_output,
|
||||
)
|
||||
self.assertIn(f"\n'{self.DATA}'('{data_stage}')\n", error_output)
|
||||
self.assertIn(
|
||||
"\noverlap. To avoid unpredictable behaviour, rerun "
|
||||
"command with non overlapping outs paths.",
|
||||
"overlap and are thus in the same tracked directory.\n"
|
||||
"To keep reproducibility, outputs should be in separate "
|
||||
"tracked directories or tracked individually.",
|
||||
error_output,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user