aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordeepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>2024-08-21 14:49:56 +0000
committerGitHub <noreply@github.com>2024-08-21 14:49:56 +0000
commitc8e94530b65d6807b2b9bb246a542963839cce9d (patch)
tree8c5004359cc3d2b2912c3531682731ec13b58bd2 /src
parentb882bb03882ce91c25880defb1461bfbd09dce43 (diff)
downloadde-project-bentley-c8e94530b65d6807b2b9bb246a542963839cce9d.tar.gz
de-project-bentley-c8e94530b65d6807b2b9bb246a542963839cce9d.zip
style: format code with Autopep8, Black and Ruff Formatter
This commit fixes the style issues introduced in b882bb0 according to the output from Autopep8, Black and Ruff Formatter. Details: https://github.com/ajschofield/de-project-bentley/pull/84
Diffstat (limited to 'src')
-rw-r--r--src/transform_lambda.py36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/transform_lambda.py b/src/transform_lambda.py
index 3a7cf43..b176ccc 100644
--- a/src/transform_lambda.py
+++ b/src/transform_lambda.py
@@ -1,4 +1,4 @@
-#from src.extract_lambda import extract_bucket
+# from src.extract_lambda import extract_bucket
import json
import boto3
import re
@@ -6,29 +6,33 @@ import io
from io import StringIO
import pandas as pd
+
def lambda_handler(event, context):
pass
-tables = ['sales_order',
- 'transaction',
- 'payment',
- 'counterparty',
- 'address',
- 'staff',
- 'purchase_order',
- 'department',
- 'currency',
- 'design',
- 'payment_type']
+tables = [
+ "sales_order",
+ "transaction",
+ "payment",
+ "counterparty",
+ "address",
+ "staff",
+ "purchase_order",
+ "department",
+ "currency",
+ "design",
+ "payment_type",
+]
+
-def read_from_s3_subfolder_to_df(tables, bucket, client=boto3.client('s3')):
+def read_from_s3_subfolder_to_df(tables, bucket, client=boto3.client("s3")):
table_dfs = {}
for table in tables:
response = client.list_objects_v2(Bucket=bucket, Prefix=table)
- list_of_keys = ['s3://'+bucket+'/'+object['Key'] for object in response['Contents']]
+ list_of_keys = [
+ "s3://" + bucket + "/" + object["Key"] for object in response["Contents"]
+ ]
list_of_df = [pd.read_csv(key) for key in list_of_keys]
table_dfs[table] = pd.concat(list_of_df)
return table_dfs
-
-
git.ajschof.me — hosted by ajschofield — powered by cgit