Skip to content

QA: params/vars and loops in dvc.yaml (2.0) round 3 #5180

@jorgeorpinel

Description

@jorgeorpinel

Continues #5165

Bugs?

  • Defining a stage with dvc repro isn't fully compatible with using ${} substitutions in commands e.g.

    $ dvc run -n echovar "echo \${var}"

    runs echo ${var} in which is interpreted by the terminal (and probably var doesn't exist in the env, so an empty line is printed).
    Upon dvc repro, the command executed is different: reads var from params.yaml (assuming it exists, otherwise errors out) and substitutes it in the cmd, for example echo foo (the value of the var param is printed).

  • (Fixed in run-cache: skip unhashable stages #5185) A strange edge error occurs when you try to overwrite a stage that has params and ${} substitution with dvc run --force. E.g.:

    stages:
      hasparam:
        cmd: echo hello
        params:
        - var
    $ dvc run -f -n hasparam -p var "echo \${var}"
    ERROR: unexpected error - 'outs'

    TBH I'm not sure under what conditions this happens or if it's definitely related to the 2.0 dvc.yaml changes. The verbose output seems to indicate it's also related to the run-cache (so feel free to extract this to its own issue).

Feature design

  • It's not possible to combine foreach and vars in a multi-stage. dvc repro gives the following error:
    ERROR: 'dvc.yaml' format error: extra keys not allowed @ data['stages']['mystage']['foreach']

    This is mentioned as a known limitation in https://github.com/iterative/dvc/wiki/Parametrization#stage-local-vars-section. But at least the error message could be improved for now because it seems unacurate.

  • Similarly, shouldn't wdir be able work with hardcoded local vars? Not from params files listed in local vars though, I get why that's not possible.

    Also a known limitation mentioned in the wiki page

Other

Metadata

Metadata

Assignees

No one assigned

    Labels

    A: templatingRelated to the templating featurediscussionrequires active participation to reach a conclusion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions