Skip to content

Commit f7e2dc4

Browse files
committed
minimal diff
1 parent 8c0056d commit f7e2dc4

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

cloudpathlib/azure/azblobclient.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -438,17 +438,11 @@ def _remove(self, cloud_path: AzureBlobPath, missing_ok: bool = True) -> None:
438438
_hns_rmtree(self.data_lake_client, cloud_path.container, cloud_path.blob)
439439
return
440440

441-
def batches():
442-
all_blobs = (
443-
b.blob
444-
for b, is_dir in self._list_dir(cloud_path, recursive=True)
445-
if not is_dir
446-
)
447-
while batch := tuple(islice(all_blobs, 256)):
448-
yield batch
449-
441+
blobs = (
442+
b.blob for b, is_dir in self._list_dir(cloud_path, recursive=True) if not is_dir
443+
)
450444
container_client = self.service_client.get_container_client(cloud_path.container)
451-
for batch in batches():
445+
while batch := tuple(islice(blobs, 256)):
452446
container_client.delete_blobs(*batch)
453447
elif file_or_dir == "file":
454448
blob = self.service_client.get_blob_client(

0 commit comments

Comments
 (0)