MCPcopy
hub / github.com/treeverse/dvc / verify_metric

Method verify_metric

dvc/output.py:893–910  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

891 return ret
892
893 def verify_metric(self):
894 if self.fs.protocol != "local":
895 raise DvcException(f"verify metric is not supported for {self.protocol}")
896 if not self.metric:
897 return
898
899 if not os.path.exists(self.fs_path):
900 return
901
902 if os.path.isdir(self.fs_path):
903 msg = "directory '%s' cannot be used as %s."
904 logger.debug(msg, str(self), "metrics")
905 return
906
907 if not istextfile(self.fs_path, self.fs):
908 raise DvcException(
909 f"binary file '{self.fs_path}' cannot be used as metrics."
910 )
911
912 def get_obj(
913 self, filter_info: Optional[str] = None, **kwargs

Callers 2

saveMethod · 0.95
modifyMethod · 0.80

Calls 3

DvcExceptionClass · 0.90
isdirMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected