From fc8ec6aa95354b0b55b21f39644113886e040586 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sat, 10 Jun 2023 22:38:46 +0300 Subject: [PATCH] fetch: show progress when collecting --- dvc/repo/fetch.py | 13 ++++++++++--- pyproject.toml | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dvc/repo/fetch.py b/dvc/repo/fetch.py index 77d562bcb..77f974945 100644 --- a/dvc/repo/fetch.py +++ b/dvc/repo/fetch.py @@ -33,6 +33,7 @@ def fetch( # noqa: C901, PLR0913 config.NoRemoteError: thrown when downloading only local files and no remote is configured """ + from dvc.fs.callbacks import Callback from dvc_data.index.fetch import fetch as ifetch if isinstance(targets, str): @@ -65,9 +66,15 @@ def fetch( # noqa: C901, PLR0913 if remote: self.config["core"]["remote"] = remote - fetch_transferred, fetch_failed = ifetch( - _indexes(), jobs=jobs - ) # pylint: disable=assignment-from-no-return + with Callback.as_tqdm_callback( + desc="Fetching", + unit="file", + ) as cb: + fetch_transferred, fetch_failed = ifetch( + _indexes(), + jobs=jobs, + callback=cb, + ) # pylint: disable=assignment-from-no-return finally: if remote: self.config["core"]["remote"] = saved_remote diff --git a/pyproject.toml b/pyproject.toml index 7db4e7050..e551e63d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ dependencies = [ "configobj>=5.0.6", "distro>=1.3", "dpath<3,>=2.1.0", - "dvc-data>=1.2.0,<1.3.0", + "dvc-data>=1.2.1,<1.3.0", "dvc-http>=2.29.0", "dvc-render>=0.3.1,<1", "dvc-studio-client>=0.9.2,<1",