Skip to content

Commit

Permalink
feat: Updated services/post_ads/src/utils/DBaaS/s3
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Jan 30, 2024
1 parent e33e2e2 commit 6a8b8a8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions services/post_ads/src/utils/DBaaS/s3_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,19 @@ def get_file_url(self, object_name: str) -> str:
return None
return response

def delete_file(self, object_name):
def delete_file(self, object_name: str) -> dict:
"""
Deletes a file from the bucket
Deletes the specified file from the S3 bucket.
Args:
object_name (str): The name of the object to delete.
Returns:
dict: S3 delete operation response object if the delete succeeded.
None: If an exception occurred, None is returned.
Raises:
ClientError: If an error occurs when attempting to delete from S3.
"""
try:
object = self.bucket.Object(object_name)
Expand Down

0 comments on commit 6a8b8a8

Please sign in to comment.