Skip to content

Commit

Permalink
fix hdfs download_dir (#36590)
Browse files Browse the repository at this point in the history
  • Loading branch information
danleifeng committed Oct 21, 2021
1 parent 7bf2aa3 commit 66f4b29
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/paddle/distributed/fleet/utils/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,8 @@ def __subprocess_download(local_path, datas):
if self.is_file(fs_path):
return self._try_download(fs_path, local_path)
# download dir
_, all_files = self.ls_dir(fs_path)

_, all_filenames = self.ls_dir(fs_path)
all_files = [fs_path + i for i in all_filenames]
procs = []
for i in range(multi_processes):
process_datas = self._split_files(all_files, i, multi_processes)
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/tests/unittests/hdfs_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _test_download_dir(self, fs):

fs.download(src_file, dst_file)
local = LocalFS()
self.assertTrue(local.is_exist(dst_file))
self.assertTrue(local.is_exist(file1))
local.delete(dst_file)
fs.delete(src_file)

Expand Down
1 change: 1 addition & 0 deletions python/paddle/fluid/tests/unittests/test_hdfs3.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def test_hdfs(self):
self._test_upload(fs)
self._test_upload_dir(fs)
self._test_download(fs)
self._test_download_dir(fs)

def test_local(self):
fs = LocalFS()
Expand Down

0 comments on commit 66f4b29

Please sign in to comment.