-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QA: params/vars and loops in dvc.yaml (2.0) round #1 #4854
Comments
Ahh, I posted the wrong data inside dvc.yaml. It should be: stages:
build:
foreach:
us:
thresh: 10
gb:
thresh: 15
in:
cmd: echo ${item.thresh}
Thanks, this is a good one.
Not sure, as I wanted to keep the separation between foreach and the generated stages (this is complicated by the fact of
I guess this goes to the convenience part, which we can focus later. Let's focus on the design and behavior of the features and not focus too much on the error messages and cli part. As, I think the design and behavior are not quite easy to grasp for users and might not be intuitive (as seen from lots of your suggestion). That's be greatly appreciated.
That's a good design question. What should the syntax be? Is it always clear if we overwrite by default rather than erroring out? Thanks, @jorgeorpinel for the feedback. I'll focus on improving messages at a later stage, though I'll introduce a few patches for overwriting and |
OK. So mainly here the edge bug is more or less important to address first. I agree everything else is secondary but let's keep it here to follow up when the time comes, preferably before this is released to users, as that's the purpose of QA.
I don't understand how removing
I think permitting overwriting is more intuitive, because merging params and vars only if they're non-overlapping seems pretty random too. Thanks! |
This one is mostly addressed and outdated so let's continue in #5165. |
Bugs
The "Looping through a dictionary" (given under
foreach
, not read fromvars
or params file) example from Implement foreach ... in loop in dvc.yaml #4734 doesn't loop.dvc repro
just runs a single stage using the given dict as the only item in the loop.Edge: When
use: none
(wherenone
is an invalid/inexistent path) is given, no params file is used. But it seems that params.yaml is still parsed because ifvars
has a key that already exists in params.yaml, an error is thrown (since overwriting keys is not allowed). However, if the value is removed fromvars
, the value is not actually read from the params file (also resulting in an error).Usability
Foreach loops: since
in:
is always followed bycmd:
what about just avoidin
and go straight tocmd
, etc.? Like this:It's not possible to
dvc repro
stage groups, since the final stage name is built from vars/params values. E.g. in the "Looping through a list" example of Implement foreach ... in loop in dvc.yaml #4734,dvc repro build
doesn't work. You can howeverdvc repro build-foo
(which is fine). I think that entire groups should be valid targets too.Shouldbe calleduse
params-file
orimport
? "use" seems like it has a different meaning i.e. pipelines "use" all sorts of things (e.g. dependencies) and the keyworduse
in some languages has to do with namespaces (e.g. in PHP).use
accepts inexistent paths, resulting in silently not loading any params file, even if params.yaml is present. I like this asuse: none
could be a useful trick, but should it at warn that the given file doesn't exist?Ifis given a directory path, it prints a generic unexpected error -use
[Errno 13] Permission denied: '{path}'.
How about a check that the given path is a valid YAML file?When vars used in dvc.yaml don't exist in the params file or
vars
, you getERROR: unexpected error - Could not find '{key}' in {}: '{key}'
- improve error messageHow about a more informative message like "{key} not found in 'dvc.yaml'
vars` or '{params-file}'." ?vars
cannot overwrite values in the params file, if both are used. Is this a desired limitation?The text was updated successfully, but these errors were encountered: