Skip to content

Commit

Permalink
plots: remove legacy code from verify_metrics
Browse files Browse the repository at this point in the history
Fixes: #7988
  • Loading branch information
Yury authored and pmrowla committed Aug 2, 2022
1 parent 6a7b55f commit 116ad51
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions dvc/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 116ad51

Please sign in to comment.