|
25 | 25 | from .core import AzureDLPath, _fetch_range |
26 | 26 | from .exceptions import FileExistsError |
27 | 27 | from .transfer import ADLTransferClient |
28 | | -from .utils import commonprefix, datadir, read_block, tokenize |
| 28 | +from .utils import datadir, read_block, tokenize |
29 | 29 |
|
30 | 30 | logger = logging.getLogger(__name__) |
31 | 31 |
|
@@ -190,8 +190,8 @@ def _setup(self): |
190 | 190 | else: |
191 | 191 | rfiles = self.client._adlfs.glob(self.rpath, details=True, invalidate_cache=True) |
192 | 192 | if len(rfiles) > 1: |
193 | | - prefix = commonprefix([f['name'] for f in rfiles]) |
194 | | - file_pairs = [(os.path.join(self.lpath, os.path.relpath(f['name'] +'.inprogress', prefix)), f) |
| 193 | + local_rel_rpath = str(AzureDLPath(self.rpath).globless_prefix) |
| 194 | + file_pairs = [(os.path.join(self.lpath, os.path.relpath(f['name'] +'.inprogress', local_rel_rpath)), f) |
195 | 195 | for f in rfiles] |
196 | 196 | elif len(rfiles) == 1: |
197 | 197 | if os.path.exists(self.lpath) and os.path.isdir(self.lpath): |
@@ -442,8 +442,8 @@ def _setup(self): |
442 | 442 | lfiles = glob.glob(self.lpath) |
443 | 443 |
|
444 | 444 | if len(lfiles) > 1: |
445 | | - prefix = commonprefix(lfiles) |
446 | | - file_pairs = [(f, self.rpath / AzureDLPath(f).relative_to(prefix)) for f in lfiles] |
| 445 | + local_rel_lpath = str(AzureDLPath(self.lpath).globless_prefix) |
| 446 | + file_pairs = [(f, self.rpath / AzureDLPath(f).relative_to(local_rel_lpath)) for f in lfiles] |
447 | 447 | elif lfiles: |
448 | 448 | if self.client._adlfs.exists(self.rpath, invalidate_cache=True) and \ |
449 | 449 | self.client._adlfs.info(self.rpath, invalidate_cache=False)['type'] == "DIRECTORY": |
|
0 commit comments