Repository: iterative/dvc

Issue:
dvc pull gives python error as of version 0.63.4
DVC version 0.63.4
Ubuntu 18.04
Installed via pip via poetry

After upgrading DVC from 0.62.1 to 0.63.4 I started seeing this error when our CI system does a dvc pull command:


` dvc pull --jobs 3 --with-deps ./ImputeByEcg.dvc`
`ERROR: unexpected error - type object got multiple values for keyword argument 'desc'`



Discussion:
Hi @BernMcCarty !

Could you please show `dvc pull --jobs 3 --with-deps ./ImputeByEcg.dvc -v` output?
In case it is helpful, the tqdm version that I am using here is 4.35.0.

    dvc pull --jobs 3 --with-deps ./ImputeByEcg.dvc -v 
    DEBUG: PRAGMA user_version;
    DEBUG: fetched: [(3,)]
    DEBUG: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, size TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL)
    DEBUG: CREATE TABLE IF NOT EXISTS state_info (count INTEGER)
    DEBUG: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL)
    DEBUG: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info)
    DEBUG: PRAGMA user_version = 3;
    DEBUG: Preparing to download data from 's3://cv-pipeline/dvc'
    DEBUG: Preparing to collect status from s3://cv-pipeline/dvc
    DEBUG: Collecting information from local cache...
    DEBUG: SELECT count from state_info WHERE rowid=?
    DEBUG: fetched: [(0,)]
    DEBUG: UPDATE state_info SET count = ? WHERE rowid = ?
    ERROR: unexpected error - type object got multiple values for keyword argument 'desc'
    ------------------------------------------------------------
    Traceback (most recent call last):
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/main.py", line 43, in main
        ret = cmd.run()
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/command/data_sync.py", line 31, in run
        recursive=self.args.recursive,
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/repo/__init__.py", line 33, in wrapper
        ret = f(repo, *args, **kwargs)
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/repo/pull.py", line 25, in pull
        recursive=recursive,
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/repo/fetch.py", line 54, in _fetch
        used, jobs, remote=remote, show_checksums=show_checksums
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/data_cloud.py", line 81, in pull
        show_checksums=show_checksums,
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/remote/local.py", line 389, in pull
        download=True,
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/remote/local.py", line 353, in _process
        download=download,
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/remote/local.py", line 262, in status
        local_exists = self.cache_exists(md5s, jobs=jobs, name=self.cache_dir)
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/remote/local.py", line 218, in cache_exists
        + ("cache in " + name if name else "local cache"),
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/dvc/progress.py", line 99, in __init__
        **kwargs
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/tqdm/_tqdm.py", line 988, in __init__
        self.display()
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/tqdm/_tqdm.py", line 1376, in display
        self.sp(self.__repr__() if msg is None else msg)
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/tqdm/_tqdm.py", line 1022, in __repr__
        return self.format_meter(**self.format_dict)
    File "/home/DisiGitLabRunner/.cache/pypoetry/virtualenvs/cv-pipeline-py3.6/lib/python3.6/site-packages/tqdm/_tqdm.py", line 442, in format_meter
        **extra_kwargs)
    TypeError: type object got multiple values for keyword argument 'desc'
    ------------------------------------------------------------
@casperdcl Could you please take a look? :slightly_smiling_face: 
that's definitely an outdated version of `tqdm` being used (the path is `tqdm/_tqdm.py` instead of `tqdm/std.py`). @BernMcCarty  `pip install -U tqdm` or `pip install -U dvc` should hopefully fix the issue. If not, please re-post the error output.
@casperdcl But we have ` 4.35.0` in our deps, so we should we update it as well?
I encountered the same issue and I have an up-to-date `tqdm` (4.36.1).
The issue seems to be the workaround of a corner case in our `format_dict` that defines the `desc` dict field. This dict is expanded as kwargs by tqdm's formatter but `desc` is already defined there.

Resolving patch:
diff --git a/dvc/progress.py b/dvc/progress.py
--- a/dvc/progress.py
+++ b/dvc/progress.py
@@ -134,7 +134,7 @@ def format_dict(self):
         if ncols_desc:
             d["ncols_desc"] = ncols_desc
         else:
-            # work-around for zero-width desc
+            # work-around for zero-width description
             d["ncols_desc"] = 1
-            d["desc"] = 0
+            d["prefix"] = ""
         return d


Test patch: