-
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
repro
: Cannot interpolate data of type 'list'
#8372
Comments
dvc.yaml
: Cannot interpolate data of type 'list'
dvc.yaml
: Cannot interpolate data of type 'list'repro
: Cannot interpolate data of type 'list'
Related: #6107 |
@TheFirstMe You can workaround this with https://dvc.org/doc/user-guide/project-structure/dvcyaml-files#dict-unpacking if you wrap the list inside a dict: dict:
list: ['a', 'b', 'c']
|
Yes, I am currently doing something like this. But the parameter list is something that will be accessed by multiple stages so I wanted to keep it under a common section (base). |
@TheFirstMe does something like the following serves your purpose? # params.yaml
base:
loglevel: INFO
list:
list: ['a', 'b', 'c']
random-key: 0.1
stage1:
param1: 0.1
param2: 0.2
param3: 0.3
stage2:
param1: 0.3
param2: 0.2 # dvc.yaml
stages:
stage1:
cmd: >-
python script.py
${stage1}
${base.list}
--random-key ${base.random-key}
--log-level ${base.loglevel}
deps:
- script.py
stage2:
cmd: >-
python script.py
${stage2}
${base.list}
--random-key ${base.random-key}
--log-level ${base.loglevel}
deps:
- script.py As you can see, the common parameters remain under the If you really do not want to write the other parameters, you can simply group them in another key, within the same (or another) dictionary: base:
list:
list: ['a', 'b', 'c']
others:
log-level: INFO
random-key: 0.1
# ... stages:
stage1:
cmd: >-
python script.py
${stage1}
${base.list}
${base.others}
deps:
- script.py
# ... This is a workaround, I would expect for plain list interpolation to land some time in the (near?) future. |
This is a sample of my dvc.yaml.
and my params.yaml looks like this:
dvc repro
currently results in this error:The expected command is
python train.py --list 'a' 'b' 'c'
The text was updated successfully, but these errors were encountered: