Dvc: `dvc config cache.type` should print default values if there is no "cache" section in configuration file

Created on 26 May 2019  路  3Comments  路  Source: iterative/dvc

If I didn't modified cache settings in the project and I run dvc config --local cache.type I will get the following error:

ERROR: failed to show 'cache.type' - config file error: section 'cache' doesn't exist

The same happens if I run dvc config --system cache.type and dvc config --global cache.type and if I didn't set system and global values manually.

It would be more useful to print default values in all these cases.

c3-small-fix feature request p3-nice-to-have

Most helpful comment

Some related discussion - https://stackoverflow.com/questions/33720397/git-config-list-all-variables-and-their-default-values . If feels though that introducing a separate command for each potential option is not scalable. We need to find a centralized way of printing all options similar to MySQL's show variables.

All 3 comments

Hi @nik123 !

dvc config is meant to be very simple and straightforward, so it shouldn't print default values if they are not set in the config file itself. This is similar to git config behaviour. The functionality you are mentioning should a part of dvc cache command (dvc cache type, to be more precise). We don't have that command yet though, but it is a logical extension of the currently existing dvc cache dir. Related to https://github.com/iterative/dvc/issues/1998 . Let us know if you would be willing to contribute that feature, we will try to help with everything we can :slightly_smiling_face:

Thanks,
Ruslan

Some related discussion - https://stackoverflow.com/questions/33720397/git-config-list-all-variables-and-their-default-values . If feels though that introducing a separate command for each potential option is not scalable. We need to find a centralized way of printing all options similar to MySQL's show variables.

We need to find a centralized way of printing all options similar to MySQL's show variables.

I see two options to provide a way to get any option wether it is stored in local/global/system config file or not:

  1. If no new value for the option is passed through dvc config command (i.e. git config cache.dir, git config --local cache.type) then config command should print out efficient value regardless it's explicitly set in configuration file or not
  2. Provide additional command in dvc which print outs all efficient values, something like dvc config current.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmpetrov picture dmpetrov  路  35Comments

kevin-hanselman picture kevin-hanselman  路  37Comments

yukw777 picture yukw777  路  45Comments

kskyten picture kskyten  路  44Comments

pared picture pared  路  73Comments