randr97 commented on a change in pull request #8895:
URL: https://github.com/apache/airflow/pull/8895#discussion_r426706026



##########
File path: airflow/providers/amazon/aws/hooks/s3.py
##########
@@ -664,6 +664,23 @@ def copy_object(self,
                                                ACL=acl_policy)
         return response
 
+    @provide_bucket_name
+    def delete_bucket(self, bucket_name) -> None:
+        """
+        To delete s3 bucket, delete all s3 bucket objects and then delete the 
bucket.
+
+        :param bucket_name: Bucket name
+        :type bucket_name: str
+        :return: None
+        :rtype: None
+        """
+        bucket_keys = self.list_keys(bucket_name=bucket_name)
+        if bucket_keys:

Review comment:
       @ashb There is an option to delete all bucket objects using 
bucket.objects.all().delete(),
   but logging each deleted bucket will be tricky as there might be a few 
objects that might get deleted and a few might fail. How do we handle this case?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to