fetch: show progress when collecting

This commit is contained in:
Ruslan Kuprieiev
2023-06-10 22:48:16 +03:00
parent 3dca69b678
commit fc8ec6aa95
2 changed files with 11 additions and 4 deletions
+8 -1
View File
@@ -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,8 +66,14 @@ def fetch( # noqa: C901, PLR0913
if remote:
self.config["core"]["remote"] = remote
with Callback.as_tqdm_callback(
desc="Fetching",
unit="file",
) as cb:
fetch_transferred, fetch_failed = ifetch(
_indexes(), jobs=jobs
_indexes(),
jobs=jobs,
callback=cb,
) # pylint: disable=assignment-from-no-return
finally:
if remote:
+1 -1
View File
@@ -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",