@@ -558,25 +558,29 @@ def _get( # noqa: C901
558
558
for d in _dirs :
559
559
os .mkdir (d )
560
560
561
+ repo_fs = self .repo .fs
562
+
561
563
def _get_file (arg ):
562
564
dvc_fs , src , dest , info = arg
563
565
dvc_info = info .get ("dvc_info" )
564
- if dvc_info and dvc_fs :
566
+ fs_info = info .get ("fs_info" )
567
+ if dvc_fs and dvc_info and not fs_info :
565
568
dvc_path = dvc_info ["name" ]
566
569
dvc_fs .get_file (
567
570
dvc_path , dest , callback = callback , info = dvc_info , ** kwargs
568
571
)
569
572
else :
570
- self .get_file (src , dest , callback = callback , ** kwargs )
573
+ fs_path = fs_info ["name" ]
574
+ repo_fs .get_file (fs_path , dest , callback = callback , ** kwargs )
571
575
return src , dest , info
572
576
573
577
with ThreadPoolExecutor (max_workers = batch_size ) as executor :
574
578
return list (executor .imap_unordered (_get_file , _files ))
575
579
576
580
def get_file (self , rpath , lpath , ** kwargs ):
581
+ dvc_info = kwargs .pop ("info" , {}).pop ("dvc_info" , None )
577
582
key = self ._get_key_from_relative (rpath )
578
583
fs_path = self ._from_key (key )
579
-
580
584
dirpath = os .path .dirname (lpath )
581
585
if dirpath :
582
586
# makedirs raises error if the string is empty
@@ -590,7 +594,7 @@ def get_file(self, rpath, lpath, **kwargs):
590
594
raise
591
595
592
596
dvc_path = _get_dvc_path (dvc_fs , subkey )
593
- return dvc_fs .get_file (dvc_path , lpath , ** kwargs )
597
+ return dvc_fs .get_file (dvc_path , lpath , info = dvc_info , ** kwargs )
594
598
595
599
def du (self , path , total = True , maxdepth = None , withdirs = False , ** kwargs ):
596
600
if maxdepth is not None :
0 commit comments