-
Notifications
You must be signed in to change notification settings - Fork 394
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
templating: Add dict unpacking
section.
#3730
Conversation
config: Add `parsing` section. Per iterative/dvc#7907
@@ -156,6 +160,49 @@ stages: | |||
DVC will track simple param values (numbers, strings, etc.) used in `${}` (they | |||
will be listed by `dvc params diff`). | |||
|
|||
### Dict Unpacking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was already too large but I think the extraction (#3670) should be addressed in a separate P.R.
@@ -156,6 +160,49 @@ stages: | |||
DVC will track simple param values (numbers, strings, etc.) used in `${}` (they | |||
will be listed by `dvc params diff`). | |||
|
|||
### Dict Unpacking | |||
|
|||
Only inside the `cmd` entries, you can also reference a dictionary inside `${}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget what happens if this is tried outside of cmd
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like:
ResolveError("failed to parse 'stages.build.outs' in 'dvc.yaml':\nCannot interpolate data of type 'dict'")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was already too large but I think the extraction (#3670) should be addressed in a separate P.R.
Agree, still this probably doesn't need an H3 sub-section, we could summarize more.
Some edits base on the existing text for now:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the config parsing
ref...
p.s. #340 becomes even more urgent...
- `parsing.bool` - Controls the templating syntax for boolean values when used | ||
in | ||
[dict unpacking](/doc/user-guide/project-structure/pipelines-files#dict-unpacking). |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also for lists though, right @daavoo ? Any other types?
Given the following `params.yaml`: | ||
|
||
```yaml | ||
dict: | ||
bool-true: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything else should probably be a separate Example, not part of the parsing.bool
bullet.
- `parsing.list` - Controls the templating syntax for list values when used in | ||
[dict unpacking](/doc/user-guide/project-structure/pipelines-files#dict-unpacking). | ||
|
||
Valid values are `"nargs"` (default) and `"append"`, named after | ||
[Python argparse actions](https://docs.python.org/3/library/argparse.html#action). | ||
|
||
Given the following `params.yaml`: | ||
|
||
```yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments for the parsing.list
bullet
Ping @daavoo . Could you take a look and address the comments from @jorgeorpinel in a new PR? |
Oh thanks for the follow-up @dberenbaum . @daavoo note that I'm touching the Dictionary unpacking section in #3789 (feel free to contribute there or wait after it's merged). |
@daavoo I started addressing my comments above in #3789, including the ones on the cmd ref before I realized that part should be a different PR. So I started #3858 for that and assigned you. Thanks 🙂 |
* initial plan and some content * added content about stages * title and restyle fixes * added dag section * depend to -> depend on * added dependencies section * Update content/docs/user-guide/pipelines/index.md * Update content/docs/user-guide/pipelines/index.md * Restyled by prettier (#3532) Co-authored-by: Restyled.io <[email protected]> * Update content/docs/user-guide/pipelines/index.md Co-authored-by: Jorge Orpinel <[email protected]> * added pipelines to sidebar * updated the title * fixed formatting * updating for dvc.yaml first * fed -> used * dvc.yaml-first * editing to tell dvc.yaml first * minor fix * url dependency * dvc lock example * section titles for deps * section titles for outputs * reproduction -> running * adding hyperparameters section * added experiments section * adding url dependencies * added outputs section content * minor * added running pipelines content * moved outputs below running * removed plots section header * guide: Defining Data Pipelines * guide: split up Data Pipelines section * Update content/docs/command-reference/plots/templates.md * guide: Data Pipes -> ML Pipes per #3414 (review) * guide: oops, remove op-pipes file * guide: remoge ML Pipes intro per #3414 (review) * guide: mention both imports in Def ML Pipes rel #3414 (review) * guide: move DAG info from cmd ref per #3414 (review) * guide: move all info and links about DAG to ML Pipes section about Dependency Graphs * guide: point from some Stage links to ML Pipes section on Stages (Defining Pipes) * guide: delete Running ML Pipes (for now) * nav: remove future ML Pipes guides * guide: remove ML Pipes/ Experimental Pipes * roll back unrelated changes... * guide: roll back dvc.yaml page changes per #3414 (review) * guide: link ML Pipes/ Defining Stages to dvc.yaml/stages spec * guide: some changes to start improving the dvc.yaml guide * guide: edit Stages section (dvc.yaml guide) and and move Stage entry spec to right after that. * guide: link deps and params tooltip to ML Pipes/ Stages guide sections * guide: links from dvc.yaml doc to ML Pipes/ Stages * guide: update dvc.yaml Templating spec * guide: a couple more admons for dvc.yaml doc * guide: more links * guide: oops, remove unused files * remove unrelated change * ref: update stage add/ run Descs * guide: move stage definition details to ML Pipes from cmd ref * guide: move stage definition details to ML Pipes from cmd ref * guide: move stage command details into ML Pipes re-link from existing places * guide; update Stage entries spec descs. * guide: admons for dvc.yaml page * guide: roll back wrong change * edits to dvc.yaml doc per #3730 (review) * ref: roll back unrelated changes * . * ref: few more links to dependency graph in guide * ref: refactor run, stage add, and repro a little * guide: drop old pipelines guide * ref: revert files one change moved to #4024 * pipelines: revert a bunch of files (for now) per #3789 (comment) * proper admons Co-authored-by: iterative <[email protected]> Co-authored-by: Emre Şahin <[email protected]> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <[email protected]>
config: Add
parsing
section.Per iterative/dvc#7907