config.get(section, opt) returns value as str when expects int
[core]
checksum_jobs = 10
SECTION_CORE_CHECKSUM_JOBS: All(Coerce(int), Range(1))
>>> from dvc.repo import Repo
>>> r = Repo()
>>> r.config.get('core', 'checksum_jobs')
'10' # but expects to get 10 as int
>>> r.config.config.get('core', {}).get('checksum_jobs')
10
0.81.3+aec778
Linux (pip)
@JIoJIaJIu, this is because configobject is a wrapper of configparser.
ConfigObject has methods like .as_int() to work around this (unnecessary, in my opinion).
I would rethink the current Config implementation.
Referenc: ConfigObject docs
The design of our Config object is not clear and simple) We discussed refactoring it with @efiop, but it is still waiting and we are working around things like that for now.
Most helpful comment
@JIoJIaJIu, this is because
configobjectis a wrapper ofconfigparser.ConfigObjecthas methods like.as_int()to work around this (unnecessary, in my opinion).I would rethink the current
Configimplementation.Referenc: ConfigObject docs