One thing I noticed when trying the changes from #5302 is that if the user specifies a parameter or params file that doesn't exist (i.e. typo's a param name) we just silently accept it and create the new file or new entry in the existing params file (this behavior existed before the -S/--set-param change as well).
If the specified parameter doesn't exist in the target stage/pipeline we should probably throw an error instead of silently ignoring it.
Reproduce
git clone https://github.com/iterative/example-get-started
cd example-get-started
dvc pull
virtualenv .venv
. .venv/bin/activate
pip install -r src/requirements.txt
dvc exp run -S feature.n_grams=3
git diff params.yaml
The experiment is run as normal and params.yaml has a new parameter:
diff --git a/params.yaml b/params.yaml
index e5a636f..aed2663 100644
--- a/params.yaml
+++ b/params.yaml
@@ -6,6 +6,7 @@ featurize:
max_features: 3000
ngrams: 2
+ n_grams: 3
train:
seed: 20170428
n_est: 100
(END)
Note the typo in the parameter name.
The user thinks that they have changed a parameter, and no error is reported.
Expected
I'd expect parameters' existence are checked before making any modifications. So the line with
dvc exp run -S train.n_grams=3
should report that train.n_grams is not a valid parameter.
Environment information
Output of dvc doctor:
$ dvc doctor
DVC version: 2.4.3 (pip)
---------------------------------
Platform: Python 3.8.10 on Linux-5.8.0-59-generic-x86_64-with-glibc2.29
Supports: All remotes
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/nvme0n1p2
Caches: local
Remotes: https
Workspace directory: ext4 on /dev/nvme0n1p2
Repo: dvc, git
One thing I noticed when trying the changes from #5302 is that if the user specifies a parameter or params file that doesn't exist (i.e. typo's a param name) we just silently accept it and create the new file or new entry in the existing params file (this behavior existed before the
-S/--set-paramchange as well).If the specified parameter doesn't exist in the target stage/pipeline we should probably throw an error instead of silently ignoring it.
Reproduce
The experiment is run as normal and
params.yamlhas a new parameter:Note the typo in the parameter name.
The user thinks that they have changed a parameter, and no error is reported.
Expected
I'd expect parameters' existence are checked before making any modifications. So the line with
should report that
train.n_gramsis not a valid parameter.Environment information
Output of
dvc doctor: