From 29b9c5370cd2b7073c9c8598f20336bc1713c386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Rowlands=20=28=EB=B3=80=EA=B8=B0=ED=98=B8=29?= Date: Fri, 16 Apr 2021 18:02:13 +0900 Subject: [PATCH] exp run: disallow --rev for workspace runs (#5831) --- dvc/command/experiments.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/dvc/command/experiments.py b/dvc/command/experiments.py index d64f9eb1f..a25293794 100644 --- a/dvc/command/experiments.py +++ b/dvc/command/experiments.py @@ -509,10 +509,16 @@ class CmdExperimentsRun(CmdRepro): def run(self): from dvc.command.metrics import _show_metrics - if self.args.reset and self.args.checkpoint_resume: - raise InvalidArgumentError( - "--reset and --rev are mutually exclusive." - ) + if self.args.checkpoint_resume: + if self.args.reset: + raise InvalidArgumentError( + "--reset and --rev are mutually exclusive." + ) + if not (self.args.queue or self.args.tmp_dir): + raise InvalidArgumentError( + "--rev can only be used in conjunction with " + "--queue or --temp." + ) if self.args.reset: logger.info("Any existing checkpoints will be reset and re-run.") @@ -932,9 +938,8 @@ def add_parser(subparsers, parent_parser): type=str, dest="checkpoint_resume", help=( - "Continue the specified checkpoint experiment. " - "(Only required for explicitly resuming checkpoints in queued " - "or temp dir runs.)" + "Continue the specified checkpoint experiment. Can only be used " + "in conjunction with --queue or --temp." ), metavar="", ).complete = completion.EXPERIMENT