Closed
Description
The dvc metrics remove
command doesn't work if targeted metric resides within pipeline file. The underlying issue is that Dvcfile.dump()
might dump a file or not depending on particular class.
Looks like the culprit is that PipelineFile.dump()
tries to serve two purposes, i.e. dump both pipeline file and corresponding lock file, additionally PipelineFile.dump()
has unsafe default, i.e. not really saving a pipeline file unless extra flag is passed. I would split repsponsibilities:
- Make
PipelineFile.dump()
dump pipeline file as its name suggest. - Add
PipelineFile.dump_lock()
and call that when you need to dump a lock file.
NOTE: I found this bug by spotting the unsafe default in .dump()
and looking through its uses. There might be more related bugs.
Output of dvc version
:
$ dvc version
DVC version: 1.0.0a6+bb50fb
Python version: 3.8.2
Platform: Linux-5.4.0-31-generic-x86_64-with-glibc2.27
Binary: False
Package: None
Supported remotes: http, https
Cache: reflink - not supported, hardlink - supported, symlink - supported
Repo: dvc, git