Skip to content

Commit d854f1c

Browse files
committed
chore: shorten docstrings, fix union single typehint
1 parent d2c8f30 commit d854f1c

File tree

5 files changed

+15
-16
lines changed

5 files changed

+15
-16
lines changed

aws_lambda_powertools/utilities/parameters/appconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class AppConfigProvider(BaseProvider):
3333
config: botocore.config.Config, optional
3434
Botocore configuration to pass during client initialization
3535
boto3_session : boto3.session.Session, optional
36-
Boto3 session to use for AWS API communication, will not be used if boto3_client is not None
36+
Boto3 session to create a boto3_client from
3737
boto3_client: AppConfigClient, optional
38-
Boto3 Client to use for AWS API communication, will be used instead of boto3_session if both provided
38+
Boto3 AppConfig Client to use, boto3_session will be ignored if both are provided
3939
4040
Example
4141
-------

aws_lambda_powertools/utilities/parameters/base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
TRANSFORM_METHOD_BINARY = "binary"
3030
SUPPORTED_TRANSFORM_METHODS = [TRANSFORM_METHOD_JSON, TRANSFORM_METHOD_BINARY]
3131
ParameterClients = Union["AppConfigClient", "SecretsManagerClient", "SSMClient"]
32-
ParameterResourceClients = Union["DynamoDBServiceResource"]
3332

3433

3534
class BaseProvider(ABC):
@@ -210,7 +209,7 @@ def _build_boto3_client(
210209
session : Optional[Type[boto3.Session]], optional
211210
boto3 session instance, by default None
212211
config : Optional[Type[Config]], optional
213-
botocore config instance to configure client, by default None
212+
botocore config instance to configure client with, by default None
214213
215214
Returns
216215
-------
@@ -224,21 +223,22 @@ def _build_boto3_client(
224223
config = config or Config()
225224
return session.client(service_name=service_name, config=config)
226225

226+
# maintenance: change DynamoDBServiceResource type to ParameterResourceClients when we expand
227227
@staticmethod
228228
def _build_boto3_resource_client(
229229
service_name: str,
230-
client: Optional[ParameterResourceClients] = None,
230+
client: Optional["DynamoDBServiceResource"] = None,
231231
session: Optional[Type[boto3.Session]] = None,
232232
config: Optional[Type[Config]] = None,
233233
endpoint_url: Optional[str] = None,
234-
) -> Type[ParameterResourceClients]:
234+
) -> Type["DynamoDBServiceResource"]:
235235
"""Builds a high level boto3 resource client with session, config and endpoint_url provided
236236
237237
Parameters
238238
----------
239239
service_name : str
240240
AWS service name to instantiate a boto3 client, e.g. ssm
241-
client : Optional[ParameterResourceClients], optional
241+
client : Optional[DynamoDBServiceResource], optional
242242
boto3 client instance, by default None
243243
session : Optional[Type[boto3.Session]], optional
244244
boto3 session instance, by default None
@@ -247,8 +247,8 @@ def _build_boto3_resource_client(
247247
248248
Returns
249249
-------
250-
Type[ParameterResourceClients]
251-
Instance of a boto3 client for Parameters feature (e.g., ssm, appconfig, secretsmanager, etc.)
250+
Type[DynamoDBServiceResource]
251+
Instance of a boto3 resource client for Parameters feature (e.g., dynamodb, etc.)
252252
"""
253253
if client is not None:
254254
return client

aws_lambda_powertools/utilities/parameters/dynamodb.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ class DynamoDBProvider(BaseProvider):
3535
config: botocore.config.Config, optional
3636
Botocore configuration to pass during client initialization
3737
boto3_session : boto3.session.Session, optional
38-
Boto3 session to use for AWS API communication
38+
Boto3 session to create a boto3_client from
3939
boto3_client: DynamoDBServiceResource, optional
40-
Boto3 DynamoDB Resource Client to use for AWS API communication,
41-
will be used instead of boto3_session if both provided
40+
Boto3 DynamoDB Resource Client to use; boto3_session will be ignored if both are provided
4241
4342
Example
4443
-------

aws_lambda_powertools/utilities/parameters/secrets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class SecretsProvider(BaseProvider):
2323
config: botocore.config.Config, optional
2424
Botocore configuration to pass during client initialization
2525
boto3_session : boto3.session.Session, optional
26-
Boto3 session to use for AWS API communication, will not be used if boto3_client is not None
26+
Boto3 session to create a boto3_client from
2727
boto3_client: SecretsManagerClient, optional
28-
Boto3 Client to use for AWS API communication, will be used instead of boto3_session if both provided
28+
Boto3 SecretsManager Client to use, boto3_session will be ignored if both are provided
2929
3030
Example
3131
-------

aws_lambda_powertools/utilities/parameters/ssm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class SSMProvider(BaseProvider):
2323
config: botocore.config.Config, optional
2424
Botocore configuration to pass during client initialization
2525
boto3_session : boto3.session.Session, optional
26-
Boto3 session to use for AWS API communication, will not be used if boto3_client is not None
26+
Boto3 session to create a boto3_client from
2727
boto3_client: SSMClient, optional
28-
Boto3 Client to use for AWS API communication, will be used instead of boto3_session if both provided
28+
Boto3 SSM Client to use, boto3_session will be ignored if both are provided
2929
3030
Example
3131
-------

0 commit comments

Comments
 (0)