Skip to content

Commit 0fb4121

Browse files
Fix actions braking changes
1 parent ecce865 commit 0fb4121

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

aws_lambda_powertools/utilities/data_masking/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def _apply_action_to_fields(
406406

407407
json_parse.update(
408408
data_parsed,
409-
lambda field_value, fields, field_name: update_callback(field_value, fields, field_name), # type: ignore[misc] # noqa: B023
409+
update_callback, # type: ignore[misc] # noqa: B023
410410
)
411411

412412
return data_parsed

aws_lambda_powertools/utilities/feature_flags/feature_flags.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from aws_lambda_powertools.utilities.feature_flags.types import JSONType, P, T
2424

2525

26-
RULE_ACTION_MAPPING = {
26+
RULE_ACTION_MAPPING: dict[str, Callable[..., bool]] = {
2727
schema.RuleAction.EQUALS.value: lambda a, b: a == b,
2828
schema.RuleAction.NOT_EQUALS.value: lambda a, b: a != b,
2929
schema.RuleAction.KEY_GREATER_THAN_VALUE.value: lambda a, b: a > b,
@@ -38,13 +38,13 @@
3838
schema.RuleAction.KEY_NOT_IN_VALUE.value: lambda a, b: a not in b,
3939
schema.RuleAction.VALUE_IN_KEY.value: lambda a, b: b in a,
4040
schema.RuleAction.VALUE_NOT_IN_KEY.value: lambda a, b: b not in a,
41-
schema.RuleAction.ALL_IN_VALUE.value: lambda a, b: compare_all_in_list(a, b),
42-
schema.RuleAction.ANY_IN_VALUE.value: lambda a, b: compare_any_in_list(a, b),
43-
schema.RuleAction.NONE_IN_VALUE.value: lambda a, b: compare_none_in_list(a, b),
44-
schema.RuleAction.SCHEDULE_BETWEEN_TIME_RANGE.value: lambda a, b: compare_time_range(a, b),
45-
schema.RuleAction.SCHEDULE_BETWEEN_DATETIME_RANGE.value: lambda a, b: compare_datetime_range(a, b),
46-
schema.RuleAction.SCHEDULE_BETWEEN_DAYS_OF_WEEK.value: lambda a, b: compare_days_of_week(a, b),
47-
schema.RuleAction.MODULO_RANGE.value: lambda a, b: compare_modulo_range(a, b),
41+
schema.RuleAction.ALL_IN_VALUE.value: compare_all_in_list,
42+
schema.RuleAction.ANY_IN_VALUE.value: compare_any_in_list,
43+
schema.RuleAction.NONE_IN_VALUE.value: compare_none_in_list,
44+
schema.RuleAction.SCHEDULE_BETWEEN_TIME_RANGE.value: compare_time_range,
45+
schema.RuleAction.SCHEDULE_BETWEEN_DATETIME_RANGE.value: compare_datetime_range,
46+
schema.RuleAction.SCHEDULE_BETWEEN_DAYS_OF_WEEK.value: compare_days_of_week,
47+
schema.RuleAction.MODULO_RANGE.value: compare_modulo_range,
4848
}
4949

5050

aws_lambda_powertools/utilities/idempotency/persistence/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ def _get_hashed_idempotency_key(self, data: dict[str, Any]) -> str | None:
111111
112112
"""
113113
if self.event_key_jmespath:
114-
data = self.event_key_compiled_jmespath.search(data, options=jmespath.Options(**self.jmespath_options))
114+
data = self.event_key_compiled_jmespath.search(
115+
data,
116+
options=jmespath.Options(**(self.jmespath_options or {})),
117+
)
115118

116119
if self.is_missing_idempotency_key(data=data):
117120
if self.raise_on_no_idempotency_key:

aws_lambda_powertools/utilities/parameters/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def get_transform_method(value: str, transform: TransformOptions = None) -> Call
271271
transform_method = TRANSFORM_METHOD_MAPPING.get(transform)
272272

273273
if transform == "auto":
274-
key_suffix = value.rsplit(".")[-1]
274+
key_suffix = value.rsplit(".", maxsplit=1)[-1]
275275
transform_method = TRANSFORM_METHOD_MAPPING.get(key_suffix, TRANSFORM_METHOD_MAPPING[None])
276276

277277
return cast(Callable, transform_method) # https://github.com/python/mypy/issues/10740

0 commit comments

Comments
 (0)