Skip to content

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

@jorgeorpinel

Description

@jorgeorpinel

Continues #4854

Bugs?

UI/UX

  • Foreach loops: since do: always contains all the regular stage fields, what about avoiding do and go straight to cmd, etc.? Like this:
    stages:
      something:
        foreach: ...
        cmd: python script.py --thresh ${item...}
        deps: ...

    This way the only syntax change is to add the foreach field, which makes the whole entry into a stage group.

  • If a directory path in vars, repro prints a generic ERROR: unexpected error - [Errno 21] Is a directory: '{path}'. which while informative enough, seems like it could be better handled. (Fix on parametrization: fix error when the file in vars is a directory #5171)

Feature design/ Side-effects

  • There seems to be no way to indicate you don't want any params file to be loaded (even if it exists for other purposes). Earlier on you could use: none.
  • Similarly, there's no way to ONLY use an alternative params file e.g. params.json and avoid the default (params.yaml). I feel like the default behavior should be to skip params.yaml if any params files are specified.
  • vars cannot overwrite any values in params files, but params files accept repeated objects IF they can be merged without conflict. E.g.: params.json {"grp": {"a": 1}} params2.json {"grp": {"b": 2}} can both be included even when grp is overloaded, but you can't define grp at all in vars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A: templatingRelated to the templating featurediscussionrequires active participation to reach a conclusionenhancementEnhances DVCuiuser interface / interaction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions