From 3a570856f5a65a1315389b3a980cec603e121e42 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Wed, 6 Nov 2024 14:54:40 -0500 Subject: [PATCH] fix(aws.glue): `ALERT_OBJ_KEY` renamed to `OBJECT_KEY` --- capepy/aws/glue.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/capepy/aws/glue.py b/capepy/aws/glue.py index 97847fe..5a06a74 100644 --- a/capepy/aws/glue.py +++ b/capepy/aws/glue.py @@ -28,7 +28,7 @@ def __init__(self): sys.argv, [ "RAW_BUCKET_NAME", - "ALERT_OBJ_KEY", + "OBJECT_KEY", "CLEAN_BUCKET_NAME", ], ) @@ -44,13 +44,13 @@ def get_raw_file(self): """ response = self.get_client("s3").get_object( Bucket=self.parameters["RAW_BUCKET_NAME"], - Key=self.parameters["ALERT_OBJ_KEY"], + Key=self.parameters["OBJECT_KEY"], ) status = response.get("ResponseMetadata", {}).get("HTTPStatusCode") if status != 200: err = ( - f"ERROR - Could not get object {self.parameters['ALERT_OBJ_KEY']} from " + f"ERROR - Could not get object {self.parameters['OBJECT_KEY']} from " f"bucket {self.parameters['RAW_BUCKET_NAME']}. ETL Cannot continue." ) @@ -62,7 +62,7 @@ def get_raw_file(self): raise Exception(err) self.logger.info( - f"Obtained object {self.parameters['ALERT_OBJ_KEY']} from bucket" + f"Obtained object {self.parameters['OBJECT_KEY']} from bucket" f"{self.parameters['RAW_BUCKET_NAME']}" ) @@ -100,6 +100,6 @@ def write_clean_file(self, clean_data, clean_key: Optional[str] = None): raise Exception(err) self.logger.info( - f"Transformed {self.parameters['RAW_BUCKET_NAME']}/{self.parameters['ALERT_OBJ_KEY']} and wrote result " + f"Transformed {self.parameters['RAW_BUCKET_NAME']}/{self.parameters['OBJECT_KEY']} and wrote result " f"to {self.parameters['CLEAN_BUCKET_NAME']}/{clean_key}" )