Skip to content

Commit 8c20b7a

Browse files
author
Michael Brewer
authored
fix(deps): Bump dependencies and fix some of the dev tooling (#354)
1 parent 4179ac1 commit 8c20b7a

21 files changed

+311
-252
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ dev:
1010
pre-commit install
1111

1212
format:
13-
poetry run isort -rc aws_lambda_powertools tests
13+
poetry run isort aws_lambda_powertools tests
1414
poetry run black aws_lambda_powertools tests
1515

1616
lint: format
1717
poetry run flake8 aws_lambda_powertools/* tests/*
1818

1919
test:
20-
poetry run pytest -m "not perf" --cov=./ --cov-report=xml
20+
poetry run pytest -m "not perf" --cov=aws_lambda_powertools --cov-report=xml
2121
poetry run pytest --cache-clear tests/performance
2222

2323
coverage-html:
24-
poetry run pytest -m "not perf" --cov-report=html
24+
poetry run pytest -m "not perf" --cov=aws_lambda_powertools --cov-report=html
2525

2626
pr: lint test security-baseline complexity-baseline
2727

aws_lambda_powertools/shared/functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def resolve_truthy_env_var_choice(env: Any, choice: bool = None) -> bool:
6-
""" Pick explicit choice over truthy env value, if available, otherwise return truthy env value
6+
"""Pick explicit choice over truthy env value, if available, otherwise return truthy env value
77
88
NOTE: Environment variable should be resolved by the caller.
99
@@ -23,7 +23,7 @@ def resolve_truthy_env_var_choice(env: Any, choice: bool = None) -> bool:
2323

2424

2525
def resolve_env_var_choice(env: Any, choice: bool = None) -> Union[bool, Any]:
26-
""" Pick explicit choice over env, if available, otherwise return env value received
26+
"""Pick explicit choice over env, if available, otherwise return env value received
2727
2828
NOTE: Environment variable should be resolved by the caller.
2929

aws_lambda_powertools/utilities/batch/sqs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _clean(self):
126126
else:
127127
logger.debug(f"{len(self.fail_messages)} records failed processing, raising exception")
128128
raise SQSBatchProcessingError(
129-
msg=f"Not all records processed succesfully. {len(self.exceptions)} individual errors logged "
129+
msg=f"Not all records processed successfully. {len(self.exceptions)} individual errors logged "
130130
f"separately below.",
131131
child_exceptions=self.exceptions,
132132
)

aws_lambda_powertools/utilities/data_classes/api_gateway_proxy_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def account_id(self) -> Optional[str]:
1616
@property
1717
def api_key(self) -> Optional[str]:
1818
"""For API methods that require an API key, this variable is the API key associated with the method request.
19-
For methods that don't require an API key, this variable is null. """
19+
For methods that don't require an API key, this variable is null."""
2020
return self["requestContext"]["identity"].get("apiKey")
2121

2222
@property

aws_lambda_powertools/utilities/data_classes/appsync_resolver_event.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ def parent_type_name(self) -> str:
115115
return self["parentTypeName"]
116116

117117
@property
118-
def variables(self) -> Dict[str, str]:
118+
def variables(self) -> Optional[Dict[str, str]]:
119119
"""A map which holds all variables that are passed into the GraphQL request."""
120120
return self.get("variables")
121121

122122
@property
123-
def selection_set_list(self) -> List[str]:
123+
def selection_set_list(self) -> Optional[List[str]]:
124124
"""A list representation of the fields in the GraphQL selection set. Fields that are aliased will
125125
only be referenced by the alias name, not the field name."""
126126
return self.get("selectionSetList")
@@ -147,7 +147,7 @@ class AppSyncResolverEvent(DictWrapper):
147147
def __init__(self, data: dict):
148148
super().__init__(data)
149149

150-
info: dict = data.get("info")
150+
info: Optional[dict] = data.get("info")
151151
if not info:
152152
info = {"fieldName": self.get("fieldName"), "parentTypeName": self.get("typeName")}
153153

@@ -164,7 +164,7 @@ def field_name(self) -> str:
164164
return self.info.field_name
165165

166166
@property
167-
def arguments(self) -> Dict[str, any]:
167+
def arguments(self) -> Dict[str, Any]:
168168
"""A map that contains all GraphQL arguments for this field."""
169169
return self["arguments"]
170170

@@ -181,7 +181,7 @@ def identity(self) -> Union[None, AppSyncIdentityIAM, AppSyncIdentityCognito]:
181181
return get_identity_object(self.get("identity"))
182182

183183
@property
184-
def source(self) -> Dict[str, any]:
184+
def source(self) -> Optional[Dict[str, Any]]:
185185
"""A map that contains the resolution of the parent field."""
186186
return self.get("source")
187187

@@ -191,7 +191,7 @@ def request_headers(self) -> Dict[str, str]:
191191
return self["request"]["headers"]
192192

193193
@property
194-
def prev_result(self) -> Optional[Dict[str, any]]:
194+
def prev_result(self) -> Optional[Dict[str, Any]]:
195195
"""It represents the result of whatever previous operation was executed in a pipeline resolver."""
196196
prev = self.get("prev")
197197
if not prev:

aws_lambda_powertools/utilities/data_classes/cognito_user_pool_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def user_attributes(self) -> Dict[str, str]:
589589
@property
590590
def user_not_found(self) -> Optional[bool]:
591591
"""A Boolean that is populated when PreventUserExistenceErrors is set to ENABLED for your user pool client.
592-
A value of true means that the user id (user name, email address, etc.) did not match any existing users. """
592+
A value of true means that the user id (user name, email address, etc.) did not match any existing users."""
593593
return self["request"].get("userNotFound")
594594

595595
@property

aws_lambda_powertools/utilities/data_classes/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def query_string_parameters(self) -> Optional[Dict[str, str]]:
5050
return self.get("queryStringParameters")
5151

5252
@property
53-
def is_base64_encoded(self) -> bool:
53+
def is_base64_encoded(self) -> Optional[bool]:
5454
return self.get("isBase64Encoded")
5555

5656
@property

aws_lambda_powertools/utilities/data_classes/connect_contact_flow_event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def address(self) -> str:
2929

3030
@property
3131
def endpoint_type(self) -> ConnectContactFlowEndpointType:
32-
"""The enpoint type."""
32+
"""The endpoint type."""
3333
return ConnectContactFlowEndpointType[self["Type"]]
3434

3535

aws_lambda_powertools/utilities/idempotency/persistence/dynamodb.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ def __init__(
4747
boto3_session : boto3.session.Session, optional
4848
Boto3 session to use for AWS API communication
4949
50-
args
51-
kwargs
52-
5350
Examples
5451
--------
5552
**Create a DynamoDB persistence layer with custom settings**
@@ -161,4 +158,4 @@ def _update_record(self, data_record: DataRecord):
161158

162159
def _delete_record(self, data_record: DataRecord) -> None:
163160
logger.debug(f"Deleting record for idempotency key: {data_record.idempotency_key}")
164-
self.table.delete_item(Key={self.key_attr: data_record.idempotency_key},)
161+
self.table.delete_item(Key={self.key_attr: data_record.idempotency_key})

aws_lambda_powertools/utilities/parameters/appconfig.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ class AppConfigProvider(BaseProvider):
6060

6161
client = None
6262

63-
def __init__(
64-
self, environment: str, application: Optional[str] = None, config: Optional[Config] = None,
65-
):
63+
def __init__(self, environment: str, application: Optional[str] = None, config: Optional[Config] = None):
6664
"""
6765
Initialize the App Config client
6866
"""

aws_lambda_powertools/utilities/parameters/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def get(
9595
if transform is not None:
9696
value = transform_value(value, transform)
9797

98-
self.store[key] = ExpirableValue(value, datetime.now() + timedelta(seconds=max_age),)
98+
self.store[key] = ExpirableValue(value, datetime.now() + timedelta(seconds=max_age))
9999

100100
return value
101101

@@ -164,7 +164,7 @@ def get_multiple(
164164

165165
values[key] = transform_value(value, _transform, raise_on_transform_error)
166166

167-
self.store[key] = ExpirableValue(values, datetime.now() + timedelta(seconds=max_age),)
167+
self.store[key] = ExpirableValue(values, datetime.now() + timedelta(seconds=max_age))
168168

169169
return values
170170

aws_lambda_powertools/utilities/parameters/ssm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ class SSMProvider(BaseProvider):
7474

7575
client = None
7676

77-
def __init__(
78-
self, config: Optional[Config] = None,
79-
):
77+
def __init__(self, config: Optional[Config] = None):
8078
"""
8179
Initialize the SSM Parameter Store client
8280
"""

aws_lambda_powertools/utilities/parser/envelopes/dynamodb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class DynamoDBStreamEnvelope(BaseEnvelope):
12-
""" DynamoDB Stream Envelope to extract data within NewImage/OldImage
12+
"""DynamoDB Stream Envelope to extract data within NewImage/OldImage
1313
1414
Note: Values are the parsed models. Images' values can also be None, and
1515
length of the list is the record's amount in the original event.

aws_lambda_powertools/utilities/parser/envelopes/sns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SnsEnvelope(BaseEnvelope):
1616
1717
Note: Records will be parsed the same way so if model is str,
1818
all items in the list will be parsed as str and npt as JSON (and vice versa)
19-
"""
19+
"""
2020

2121
def parse(self, data: Optional[Union[Dict[str, Any], Any]], model: Type[Model]) -> List[Optional[Model]]:
2222
"""Parses records found with model provided

aws_lambda_powertools/utilities/typing/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
from .lambda_context import LambdaContext
88

9-
__all__ = [
10-
"LambdaContext",
11-
]
9+
__all__ = ["LambdaContext"]
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
class SchemaValidationError(Exception):
22
"""When serialization fail schema validation"""
33

4-
pass
5-
64

75
class InvalidSchemaFormatError(Exception):
86
"""When JSON Schema is in invalid format"""
97

10-
pass
11-
128

139
class InvalidEnvelopeExpressionError(Exception):
1410
"""When JMESPath fails to parse expression"""

0 commit comments

Comments
 (0)