Skip to content

Commit 31158dd

Browse files
author
Michal Ploski
committed
Fix black and mypy warnings
1 parent d687ce9 commit 31158dd

File tree

10 files changed

+1460
-857
lines changed

10 files changed

+1460
-857
lines changed

Diff for: CHANGELOG.md

+1,457-848
Large diffs are not rendered by default.

Diff for: aws_lambda_powertools/event_handler/api_gateway.py

-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,6 @@ def route(
836836
# Override _compile_regex to exclude trailing slashes for route resolution
837837
@staticmethod
838838
def _compile_regex(rule: str, base_regex: str = _ROUTE_REGEX):
839-
840839
return super(APIGatewayRestResolver, APIGatewayRestResolver)._compile_regex(rule, "^{}/*$")
841840

842841

Diff for: aws_lambda_powertools/logging/utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def copy_config_to_registered_loggers(
1212
exclude: Optional[Set[str]] = None,
1313
include: Optional[Set[str]] = None,
1414
) -> None:
15-
1615
"""Copies source Logger level and handler to all registered loggers for consistent formatting.
1716
1817
Parameters

Diff for: aws_lambda_powertools/utilities/feature_flags/schema.py

-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ def __init__(self, rule: Dict[str, Any], rule_name: str, logger: Optional[Union[
272272
self.logger = logger or logging.getLogger(__name__)
273273

274274
def validate(self):
275-
276275
if not self.conditions or not isinstance(self.conditions, list):
277276
self.logger.debug(f"Condition is empty or invalid for rule={self.rule_name}")
278277
raise SchemaValidationError(f"Invalid condition, rule={self.rule_name}")

Diff for: aws_lambda_powertools/utilities/idempotency/persistence/dynamodb.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _put_record(self, data_record: DataRecord) -> None:
154154
if data_record.in_progress_expiry_timestamp is not None:
155155
item[self.in_progress_expiry_attr] = {"N": str(data_record.in_progress_expiry_timestamp)}
156156

157-
if self.payload_validation_enabled:
157+
if self.payload_validation_enabled and data_record.payload_hash:
158158
item[self.validation_key_attr] = {"S": data_record.payload_hash}
159159

160160
now = datetime.datetime.now()

Diff for: tests/e2e/idempotency/handlers/parallel_execution_handler.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
@idempotent(persistence_store=persistence_layer)
1414
def lambda_handler(event, context):
15-
1615
time.sleep(5)
1716

1817
return event

Diff for: tests/e2e/idempotency/handlers/ttl_cache_expiration_handler.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
@idempotent(config=config, persistence_store=persistence_layer)
1616
def lambda_handler(event, context):
17-
1817
time_now = time.time()
1918

2019
return {"time": str(time_now)}

Diff for: tests/e2e/idempotency/handlers/ttl_cache_timeout_handler.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
@idempotent(config=config, persistence_store=persistence_layer)
1616
def lambda_handler(event, context):
17-
1817
sleep_time: int = event.get("sleep") or 0
1918
time.sleep(sleep_time)
2019

Diff for: tests/e2e/parameters/infrastructure.py

-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def create_resources(self):
3434
)
3535

3636
def _create_app_config(self, function: Function):
37-
3837
service_name = build_service_name()
3938

4039
cfn_application = appconfig.CfnApplication(
@@ -82,7 +81,6 @@ def _create_app_config_freeform(
8281
function: Function,
8382
service_name: str,
8483
):
85-
8684
cfn_configuration_profile = appconfig.CfnConfigurationProfile(
8785
self.stack,
8886
"appconfig-profile",

Diff for: tests/functional/feature_flags/test_feature_flags.py

+2
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ def test_flags_conditions_rule_match_multiple_actions_multiple_rules_multiple_co
315315

316316
# check a case where the feature exists but the rule doesn't match so we revert to the default value of the feature
317317

318+
318319
# Check IN/NOT_IN/KEY_IN_VALUE/KEY_NOT_IN_VALUE/VALUE_IN_KEY/VALUE_NOT_IN_KEY conditions
319320
def test_flags_match_rule_with_in_action(mocker, config):
320321
expected_value = True
@@ -775,6 +776,7 @@ def test_get_configuration_with_envelope_and_raw(mocker, config):
775776
## Inequality test cases
776777
##
777778

779+
778780
# Test not equals
779781
def test_flags_not_equal_no_match(mocker, config):
780782
expected_value = False

0 commit comments

Comments
 (0)