From 116ad512e4b4319c2b538e44349544dd011f9aad Mon Sep 17 00:00:00 2001 From: Yury Date: Sat, 30 Jul 2022 13:57:39 +0200 Subject: [PATCH] plots: remove legacy code from verify_metrics Fixes: #7988 --- dvc/output.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dvc/output.py b/dvc/output.py index e545f24dd6..27f0713231 100644 --- a/dvc/output.py +++ b/dvc/output.py @@ -545,7 +545,7 @@ def save(self): self.ignore() - if self.metric or self.plot: + if self.metric: self.verify_metric() if not self.use_cache: @@ -708,22 +708,20 @@ def verify_metric(self): raise DvcException( f"verify metric is not supported for {self.protocol}" ) - - if not self.metric or self.plot: + if not self.metric: return if not os.path.exists(self.fs_path): return - name = "metrics" if self.metric else "plot" if os.path.isdir(self.fs_path): - msg = "directory '%s' cannot be used as %s." - logger.debug(msg, str(self), name) + logger.debug(f"directory '{self}' cannot be used as metrics.") return if not istextfile(self.fs_path, self.fs): - msg = "binary file '{}' cannot be used as {}." - raise DvcException(msg.format(self.fs_path, name)) + raise DvcException( + f"binary file '{self.fs_path}' cannot be used as metrics." + ) def download(self, to, jobs=None): from dvc.fs.callbacks import Callback