import: fix broken progressbar when importing folder (#10678)

Co-authored-by: Petr Chmelar <[email protected]>
Co-authored-by: skshetry <[email protected]>
This commit is contained in:
petrchmelar
2025-01-31 19:41:27 +05:45
committed by GitHub
co-authored by Petr Chmelar skshetry
parent b2a873d13b
commit da1e0b57b8
+4 -3
View File
@@ -500,7 +500,7 @@ class _DVCFileSystem(AbstractFileSystem):
**kwargs,
)
def _get( # noqa: C901, PLR0912
def _get( # noqa: C901, PLR0912, PLR0915
self,
rpath,
lpath,
@@ -578,7 +578,8 @@ class _DVCFileSystem(AbstractFileSystem):
kw = kwargs
if isinstance(fs, DataFileSystem):
kw = kw | {"info": info}
return fs.get_file(src, dest, callback=callback, **kw)
with callback.branched(src, dest) as child:
fs.get_file(src, dest, callback=child, **kw)
if batch_size == 1:
ctx: AbstractContextManager = nullcontext()
@@ -589,7 +590,7 @@ class _DVCFileSystem(AbstractFileSystem):
with ctx:
it = ((fs, f) for fs, files in _files.items() for f in files)
deque(map_fn(get_file, it), maxlen=0)
deque(callback.wrap(map_fn(get_file, it)), maxlen=0)
return result
def get_file(self, rpath, lpath, **kwargs):