shcherbin commented on a change in pull request #7375: [AIRFLOW-5231] Fix
S3Hook.delete_objects method
URL: https://github.com/apache/airflow/pull/7375#discussion_r376398563
##########
File path: airflow/providers/amazon/aws/hooks/s3.py
##########
@@ -610,7 +610,15 @@ def delete_objects(self, bucket, keys):
if isinstance(keys, str):
keys = [keys]
- delete_dict = {"Objects": [{"Key": k} for k in keys]}
- response = self.get_conn().delete_objects(Bucket=bucket,
Delete=delete_dict)
-
- return response
+ s3 = self.get_conn()
+ batch = 1000
Review comment:
I've added a comment and used the chunks method liked you asked. But I'm not
going to make a constant out of the batch size, as it's an implementation
detail specific only to the `S3Hook.delete_objects` method and will not be
re-used elsewhere.
----------------------------------------------------------------
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]
With regards,
Apache Git Services