Skip to content

Commit

Permalink
Merge 4908edc into 82f319f
Browse files Browse the repository at this point in the history
  • Loading branch information
milanchandna committed Jul 11, 2018
2 parents 82f319f + 4908edc commit b9349a8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.0.23 (2018-07-11)
+++++++++++++++++++
* Fixed the incorrect download location in case of UNC local paths

0.0.22 (2018-06-02)
+++++++++++++++++++
* Encoding filepaths in URI
Expand Down
2 changes: 1 addition & 1 deletion azure/datalake/store/__init__.py
Expand Up @@ -6,7 +6,7 @@
# license information.
# --------------------------------------------------------------------------

__version__ = "0.0.22"
__version__ = "0.0.23"

from .core import AzureDLFileSystem
from .multithread import ADLDownloader
Expand Down
2 changes: 1 addition & 1 deletion azure/datalake/store/multithread.py
Expand Up @@ -195,7 +195,7 @@ def _setup(self):
else:
rfiles = self.client._adlfs.glob(self.rpath, details=True, invalidate_cache=True)
if len(rfiles) > 1:
local_rel_rpath = str(AzureDLPath(self.rpath).globless_prefix)
local_rel_rpath = str(AzureDLPath(self.rpath).trim().globless_prefix)
file_pairs = [(os.path.join(self.lpath, os.path.relpath(f['name'] +'.inprogress', local_rel_rpath)), f)
for f in rfiles]
elif len(rfiles) == 1:
Expand Down
17 changes: 15 additions & 2 deletions tests/test_multithread.py
Expand Up @@ -142,6 +142,19 @@ def test_download_many(tempdir, azure):
nfiles += len(filenames)
assert nfiles > 1

@my_vcr.use_cassette
def test_download_path(azure):
with setup_tree(azure):
down = ADLDownloader(
azure,
lpath="/lpath/test/testfolder",
rpath='/' + test_dir.name,
run=False)
for lfile, rfile in down._file_pairs:
if 'data' in lfile:
lfile = AzureDLPath(lfile)
assert lfile.as_posix().startswith('/lpath/test/testfolder/data')


@my_vcr.use_cassette
def test_download_glob(tempdir, azure):
Expand All @@ -150,7 +163,7 @@ def test_download_glob(tempdir, azure):
down = ADLDownloader(azure, remote_path, tempdir, run=False,
overwrite=True)
file_pair_dict = dict(down._file_pairs)

assert len(file_pair_dict.keys()) == 2

lfiles = [os.path.relpath(f, tempdir) for f in file_pair_dict.keys()]
Expand Down Expand Up @@ -344,7 +357,7 @@ def test_upload_glob(tempdir, azure):

rfiles = [posix(AzureDLPath(f).relative_to(test_dir))
for f in file_pair_dict.values()]

assert sorted(rfiles) == sorted([posix('a', 'z.txt'), posix('b', 'z.txt')])


Expand Down

0 comments on commit b9349a8

Please sign in to comment.