Skip to content

Commit 622ad04

Browse files
authored
Merge pull request #173 from begoldsm/master
Fix a bug with over collapsing paths
2 parents 1abcf00 + 2a17b46 commit 622ad04

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ dist/
88
tests/__pycache__/
99
*.suo
1010
publish/
11-
adlsenv/
11+
adlsenv*/

HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
0.0.14 (2017-07-10)
6+
-------------------
7+
* Fix an issue where common prefixes in paths for upload and download were collapsed into only unique paths.
8+
59
0.0.13 (2017-06-28)
610
-------------------
711
* Add support for automatic refreshing of service principal credentials

azure/datalake/store/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# license information.
77
# --------------------------------------------------------------------------
88

9-
__version__ = "0.0.13"
9+
__version__ = "0.0.14"
1010

1111
from .core import AzureDLFileSystem
1212
from .multithread import ADLDownloader

azure/datalake/store/multithread.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from .core import AzureDLPath, _fetch_range
2626
from .exceptions import FileExistsError
2727
from .transfer import ADLTransferClient
28-
from .utils import commonprefix, datadir, read_block, tokenize
28+
from .utils import datadir, read_block, tokenize
2929

3030
logger = logging.getLogger(__name__)
3131

@@ -190,8 +190,8 @@ def _setup(self):
190190
else:
191191
rfiles = self.client._adlfs.glob(self.rpath, details=True, invalidate_cache=True)
192192
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)
195195
for f in rfiles]
196196
elif len(rfiles) == 1:
197197
if os.path.exists(self.lpath) and os.path.isdir(self.lpath):
@@ -442,8 +442,8 @@ def _setup(self):
442442
lfiles = glob.glob(self.lpath)
443443

444444
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]
447447
elif lfiles:
448448
if self.client._adlfs.exists(self.rpath, invalidate_cache=True) and \
449449
self.client._adlfs.info(self.rpath, invalidate_cache=False)['type'] == "DIRECTORY":

0 commit comments

Comments
 (0)