10000 Merge pull request #2 from mzjp2/abs_store · benjeffery/zarr-python@e79cb4f · GitHub
[go: up one dir, main page]

Skip to content

Commit e79cb4f

Browse files
authored
Merge pull request zarr-developers#2 from mzjp2/abs_store
Quick fix for small bugs in ABSStore class in storage.py
2 parents bb406a0 + bd1648b commit e79cb4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zarr/storage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,7 +2026,7 @@ def dir_path(self, path=None):
20262026
# prefix is normalized to not have a trailing slash
20272027
dir_path = self.prefix
20282028
if store_path:
2029-
dir_path = '/'.join(dir_path, store_path)
2029+
dir_path = os.path.join(dir_path, store_path)
20302030
else:
20312031
dir_path += '/'
20322032
return dir_path
@@ -2040,13 +2040,13 @@ def rename(self, src_path, dst_path):
20402040

20412041
def rmdir(self, path=None):
20422042
dir_path = normalize_storage_path(self.full_path(path)) + '/'
2043-
for blob in self.client.list_blobs(self.container_name, dir_path):
2043+
for blob in self.client.list_blobs(self.container_name, prefix=dir_path):
20442044
self.client.delete_blob(self.container_name, blob.name)
20452045

20462046
def getsize(self, path=None):
20472047
dir_path = self.dir_path(path)
20482048
size = 0
2049-
for blob in self.client.list_blobs(prefix=dir_path):
2049+
for blob in self.client.list_blobs(self.container_name, prefix=dir_path):
20502050
size += blob.properties.content_length # from https://stackoverflow.com/questions/47694592/get-container-sizes-in-azure-blob-storage-using-python
20512051
return size
20522052

0 commit comments

Comments
 (0)
0