File tree Expand file tree Collapse file tree
terraform/account-wide-infrastructure/modules/glue/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
12import time
23
34import boto3
45
6+ AWS_REGION = os .getenv ("AWS_REGION" , "eu-west-2" )
7+
58
69class 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 ])
You can’t perform that action at this time.
0 commit comments