Skip to content

Commit ee0e104

Browse files
committed
[NRL-1922] Resolve sonarcube issues with default and hard-coded props
1 parent a0bccf6 commit ee0e104

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

  • terraform/account-wide-infrastructure/modules/glue/src

terraform/account-wide-infrastructure/modules/glue/src/pipeline.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import os
12
import time
23

34
import boto3
45

6+
AWS_REGION = os.getenv("AWS_REGION", "eu-west-2")
7+
58

69
class LogPipeline:
710
def __init__(
@@ -13,8 +16,8 @@ def __init__(
1316
target_path,
1417
host_prefixes,
1518
job_name,
16-
partition_cols=[],
17-
transformations=[],
19+
partition_cols=None,
20+
transformations=None,
1821
):
1922
"""Initialize Glue context, Spark session, logger, and paths"""
2023
self.glue_context = glue_context
@@ -23,12 +26,12 @@ def __init__(
2326
self.source_path = source_path
2427
self.target_path = target_path
2528
self.host_prefixes = host_prefixes
26-
self.partition_cols = partition_cols
27-
self.transformations = transformations
29+
self.partition_cols = partition_cols if partition_cols else []
30+
self.transformations = transformations if transformations else []
2831
self.glue = boto3.client(
2932
service_name="glue",
30-
region_name="eu-west-2",
31-
endpoint_url="https://glue.eu-west-2.amazonaws.com",
33+
region_name=AWS_REGION,
34+
endpoint_url=f"https://glue.{AWS_REGION}.amazonaws.com",
3235
)
3336
self.job_name = job_name
3437
self.name_prefix = "-".join(job_name.split("-")[:4])

0 commit comments

Comments
 (0)