mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
dvc: don't write default values for cache/persist/metric (#3844)
This commit is contained in:
+6
-3
@@ -271,7 +271,8 @@ class BaseOutput:
|
||||
if self.IS_DEPENDENCY:
|
||||
return ret
|
||||
|
||||
ret[self.PARAM_CACHE] = self.use_cache
|
||||
if not self.use_cache:
|
||||
ret[self.PARAM_CACHE] = self.use_cache
|
||||
|
||||
if isinstance(self.metric, dict):
|
||||
if (
|
||||
@@ -280,12 +281,14 @@ class BaseOutput:
|
||||
):
|
||||
del self.metric[self.PARAM_METRIC_XPATH]
|
||||
|
||||
ret[self.PARAM_METRIC] = self.metric
|
||||
if self.metric:
|
||||
ret[self.PARAM_METRIC] = self.metric
|
||||
|
||||
if self.plot:
|
||||
ret[self.PARAM_PLOT] = self.plot
|
||||
|
||||
ret[self.PARAM_PERSIST] = self.persist
|
||||
if self.persist:
|
||||
ret[self.PARAM_PERSIST] = self.persist
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@@ -44,7 +44,12 @@ def test_add(tmp_dir, dvc):
|
||||
assert len(stage.deps) == 0
|
||||
assert stage.cmd is None
|
||||
assert stage.outs[0].info["md5"] == md5
|
||||
assert stage.md5 == "ee343f2482f53efffc109be83cc976ac"
|
||||
assert stage.md5 == "411854a9fc55b3cebda28704e41b23b3"
|
||||
|
||||
assert load_stage_file("foo.dvc") == {
|
||||
"md5": "411854a9fc55b3cebda28704e41b23b3",
|
||||
"outs": [{"md5": "acbd18db4cc2f85cedef654fccc4a4d8", "path": "foo"}],
|
||||
}
|
||||
|
||||
|
||||
def test_add_unicode(tmp_dir, dvc):
|
||||
|
||||
Reference in New Issue
Block a user