Skip to content

Commit

Permalink
Black linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary-H9 committed Mar 19, 2024
1 parent c126b06 commit 20813e8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/var/task/handler.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import os
from datetime import datetime

import boto3
from botocore.exceptions import ClientError

s3_client = boto3.client("s3")
sm_client = boto3.client("secretsmanager")


def handler(event, context):
object_key = event["Records"][0]["s3"]["object"]["key"]
supplier, file_name = object_key.split("/")[:2]
Expand All @@ -29,8 +28,8 @@ def handler(event, context):
return

# attempting to wrap this is try/except failed to delete
s3_client.delete_object(
Bucket=os.environ["PROCESSED_BUCKET_NAME"], Key=object_key
s3_client.delete_object(Bucket=os.environ["PROCESSED_BUCKET_NAME"], Key=object_key)
print(
f"Successfully deleted {object_key} from {os.environ['PROCESSED_BUCKET_NAME']}"
)
print(f"Successfully deleted {object_key} from {os.environ['PROCESSED_BUCKET_NAME']}")
print("handler.py completed successfully!")

0 comments on commit 20813e8

Please sign in to comment.