8000 used azure.storage.Blob · davidbrochart/zarr-python@7f5c5a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f5c5a9

Browse files
author
Shikhar Goenka
committed
used azure.storage.Blob
1 parent 50913cb commit 7f5c5a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

zarr/storage.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,16 +2057,17 @@ def __contains__(self, key):
20572057
return False
20582058

20592059
def listdir(self, path=None):
2060+
from azure.storage.blob import Blob
20602061
dir_path = normalize_storage_path(self._append_path_to_prefix(path))
20612062
if dir_path:
20622063
dir_path += '/'
20632064
items = list()
20642065
for blob in self.client.list_blobs(self.container, prefix=dir_path, delimiter='/'):
2065-
if '/' in blob.name[len(dir_path):]:
2066+
if type(blob) == Blob:
2067+
items.append(self._strip_prefix_from_path(blob.name, dir_path))
2068+
else:
20662069
items.append(self._strip_prefix_from_path(
20672070
blob.name[:blob.name.find('/', len(dir_path))], dir_path))
2068-
else:
2069-
items.append(self._strip_prefix_from_path(blob.name, dir_path))
20702071
return items
20712072

20722073
def rmdir(self, path=None):
@@ -2077,7 +2078,7 @@ def rmdir(self, path=None):
20772078
self.client.delete_blob(self.container, blob.name)
20782079

20792080
def getsize(self, path=None):
2080-
from azure.storage.blob.models import Blob
2081+
from azure.storage.blob import Blob
20812082
store_path = normalize_storage_path(path)
20822083
fs_path = self.prefix
20832084
if store_path:

0 commit comments

Comments
 (0)
0