Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import: fix broken progressbar when importing folder #10678

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions dvc/fs/dvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def get(
**kwargs,
)

def _get( # noqa: C901, PLR0912
def _get( # noqa: C901, PLR0912, PLR0915
skshetry marked this conversation as resolved.
Show resolved Hide resolved
self,
rpath,
lpath,
Expand Down Expand Up @@ -578,7 +578,8 @@ def get_file(arg: tuple[FileSystem, tuple[str, str, Optional[dict]]]):
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()
Expand All @@ -589,7 +590,7 @@ def get_file(arg: tuple[FileSystem, tuple[str, str, Optional[dict]]]):

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):
Expand Down
Loading