File tree 5 files changed +10
-5
lines changed
aws_lambda_powertools/utilities 5 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ def __init__(
91
91
>>> return {"StatusCode": 200}
92
92
"""
93
93
if boto3_client is None :
94
- boto3_client = (boto3_session or boto3 .session .Session ()).client ("dynamodb" , config = boto_config )
94
+ boto3_session = boto3_session or boto3 .session .Session ()
95
+ boto3_client = boto3_session .client ("dynamodb" , config = boto_config )
95
96
self .client = boto3_client
96
97
97
98
user_agent .register_feature_to_client (client = self .client , feature = "idempotency" )
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ def __init__(
79
79
Initialize the App Config client
80
80
"""
81
81
if boto3_client is None :
82
- boto3_client = (boto3_session or boto3 .session .Session ()).client ("appconfigdata" , config = config )
82
+ boto3_session = boto3_session or boto3 .session .Session ()
83
+ boto3_client = boto3_session .client ("appconfigdata" , config = config )
83
84
self .client = boto3_client
84
85
85
86
self .application = resolve_env_var_choice (
Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ def __init__(
85
85
Initialize the Secrets Manager client
86
86
"""
87
87
if boto3_client is None :
88
- boto3_client = (boto3_session or boto3 .session .Session ()).client ("secretsmanager" , config = config )
88
+ boto3_session = boto3_session or boto3 .session .Session ()
89
+ boto3_client = boto3_session .client ("secretsmanager" , config = config )
89
90
self .client = boto3_client
90
91
91
92
super ().__init__ (client = self .client )
Original file line number Diff line number Diff line change @@ -115,7 +115,8 @@ def __init__(
115
115
Initialize the SSM Parameter Store client
116
116
"""
117
117
if boto3_client is None :
118
- boto3_client = (boto3_session or boto3 .session .Session ()).client ("ssm" , config = config )
118
+ boto3_session = boto3_session or boto3 .session .Session ()
119
+ boto3_client = boto3_session .client ("ssm" , config = config )
119
120
self .client = boto3_client
120
121
121
122
super ().__init__ (client = self .client )
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ def __init__(
27
27
boto_config : Optional [Config ] = None ,
28
28
boto3_session : Optional [boto3 .session .Session ] = None ,
29
29
):
30
- self ._ddb_resource = (boto3_session or boto3 .session .Session ()).resource ("dynamodb" , config = boto_config )
30
+ boto3_session = boto3_session or boto3 .session .Session ()
31
+ self ._ddb_resource = boto3_session .resource ("dynamodb" , config = boto_config )
31
32
self .table_name = table_name
32
33
self .table = self ._ddb_resource .Table (self .table_name )
33
34
self .key_attr = key_attr
You can’t perform that action at this time.
0 commit comments