aboutsummaryrefslogtreecommitdiffstats
path: root/src/extract_lambda.py
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2024-08-19 22:29:41 +0100
committerAlex Schofield <git@ajschof.me>2024-08-19 22:29:41 +0100
commit3d4d74aa69db85e3c840b3b73c028f4e9f83d1f7 (patch)
treedf20508053e2975b1419fe6d17743715341cc0f2 /src/extract_lambda.py
parent84b3dea3833ae65d53a1007567ee19c31bf34ee3 (diff)
downloadde-project-bentley-3d4d74aa69db85e3c840b3b73c028f4e9f83d1f7.tar.gz
de-project-bentley-3d4d74aa69db85e3c840b3b73c028f4e9f83d1f7.zip
refactor(lambda_handler): remove unnecessary else statement
Diffstat (limited to 'src/extract_lambda.py')
-rw-r--r--src/extract_lambda.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/extract_lambda.py b/src/extract_lambda.py
index 1df4c34..99117a4 100644
--- a/src/extract_lambda.py
+++ b/src/extract_lambda.py
@@ -39,14 +39,13 @@ def lambda_handler(event, context):
"statusCode": 200,
"body": json.dumps("No changes detected, no CSV files were uploaded."),
}
- else:
- return {
- "statusCode": 200,
- "body": json.dumps(
- f"""CSV files processed for {', '.join(any_changes['updated'])} and uploaded successfully.{
- 'The following tables were not updated: '+', '.join(any_changes['no change']) if any_changes['no change'] else ''}"""
- ),
- }
+ return {
+ "statusCode": 200,
+ "body": json.dumps(
+ f"""CSV files processed for {', '.join(any_changes['updated'])} and uploaded successfully.{
+ 'The following tables were not updated: '+', '.join(any_changes['no change']) if any_changes['no change'] else ''}"""
+ ),
+ }
except Exception as e:
logger.error(f"Error: {e}")
return {"statusCode": 500, "body": json.dumps("Internal server error.")}
git.ajschof.me — hosted by ajschofield — powered by cgit