Skip to content

Commit 4e98567

Browse files
grlee77joshmoore
andauthored
Fix FSStore.listdir behavior for nested directories (#802)
* BUG: fix FSStore.listdir when key_separator == '/' * Bump fsspec from 2021.6.0 to 2021.7.0 * Bump to fsspec 2021.8.1 * Fix fsspec bump * Re-add moto dependency Co-authored-by: Josh Moore <[email protected]>
1 parent 1a2eeed commit 4e98567

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

requirements_dev_optional.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ flake8==3.9.2
1818
pytest-cov==2.12.1
1919
pytest-doctestplus==0.10.1
2020
h5py==3.4.0
21-
s3fs==2021.6.0
22-
fsspec==2021.6.0
23-
aiobotocore!=1.4.0
21+
fsspec[s3]==2021.08.1
2422
moto[server]>=1.3.14

zarr/storage.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,8 @@ def listdir(self, path=None):
11891189
for file_name in self.fs.find(entry_path):
11901190
file_path = os.path.join(dir_path, file_name)
11911191
rel_path = file_path.split(root_path)[1]
1192-
new_children.append(rel_path.replace(os.path.sep, '.'))
1192+
rel_path = rel_path.lstrip('/')
1193+
new_children.append(rel_path.replace('/', '.'))
11931194
else:
11941195
new_children.append(entry)
11951196
return sorted(new_children)

0 commit comments

Comments
 (0)