Skip to content

Commit

Permalink
fix remove_objects() example to convert map to list of map (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsgibbons authored Nov 19, 2023
1 parent 5d4b546 commit b8ecf63
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions minio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1997,9 +1997,15 @@ def remove_objects(self, bucket_name, delete_object_list,
print("error occurred when deleting object", error)
# Remove a prefix recursively.
delete_object_list = map(
lambda x: DeleteObject(x.object_name),
client.list_objects("my-bucket", "my/prefix/", recursive=True),
delete_object_list = list(
map(
lambda x: DeleteObject(x.object_name),
client.list_objects(
"my-bucket",
"my/prefix/",
recursive=True,
),
)
)
errors = client.remove_objects("my-bucket", delete_object_list)
for error in errors:
Expand Down

0 comments on commit b8ecf63

Please sign in to comment.