Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/data_masking/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def _apply_action_to_fields(

json_parse.update(
data_parsed,
lambda field_value, fields, field_name: update_callback(field_value, fields, field_name), # type: ignore[misc] # noqa: B023
update_callback, # type: ignore[misc] # noqa: B023
)

return data_parsed
Expand Down
16 changes: 8 additions & 8 deletions aws_lambda_powertools/utilities/feature_flags/feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from aws_lambda_powertools.utilities.feature_flags.types import JSONType, P, T


RULE_ACTION_MAPPING = {
RULE_ACTION_MAPPING: dict[str, Callable[..., bool]] = {
schema.RuleAction.EQUALS.value: lambda a, b: a == b,
schema.RuleAction.NOT_EQUALS.value: lambda a, b: a != b,
schema.RuleAction.KEY_GREATER_THAN_VALUE.value: lambda a, b: a > b,
Expand All @@ -38,13 +38,13 @@
schema.RuleAction.KEY_NOT_IN_VALUE.value: lambda a, b: a not in b,
schema.RuleAction.VALUE_IN_KEY.value: lambda a, b: b in a,
schema.RuleAction.VALUE_NOT_IN_KEY.value: lambda a, b: b not in a,
schema.RuleAction.ALL_IN_VALUE.value: lambda a, b: compare_all_in_list(a, b),
schema.RuleAction.ANY_IN_VALUE.value: lambda a, b: compare_any_in_list(a, b),
schema.RuleAction.NONE_IN_VALUE.value: lambda a, b: compare_none_in_list(a, b),
schema.RuleAction.SCHEDULE_BETWEEN_TIME_RANGE.value: lambda a, b: compare_time_range(a, b),
schema.RuleAction.SCHEDULE_BETWEEN_DATETIME_RANGE.value: lambda a, b: compare_datetime_range(a, b),
schema.RuleAction.SCHEDULE_BETWEEN_DAYS_OF_WEEK.value: lambda a, b: compare_days_of_week(a, b),
schema.RuleAction.MODULO_RANGE.value: lambda a, b: compare_modulo_range(a, b),
schema.RuleAction.ALL_IN_VALUE.value: compare_all_in_list,
schema.RuleAction.ANY_IN_VALUE.value: compare_any_in_list,
schema.RuleAction.NONE_IN_VALUE.value: compare_none_in_list,
schema.RuleAction.SCHEDULE_BETWEEN_TIME_RANGE.value: compare_time_range,
schema.RuleAction.SCHEDULE_BETWEEN_DATETIME_RANGE.value: compare_datetime_range,
schema.RuleAction.SCHEDULE_BETWEEN_DAYS_OF_WEEK.value: compare_days_of_week,
schema.RuleAction.MODULO_RANGE.value: compare_modulo_range,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ def _get_hashed_idempotency_key(self, data: dict[str, Any]) -> str | None:

"""
if self.event_key_jmespath:
data = self.event_key_compiled_jmespath.search(data, options=jmespath.Options(**self.jmespath_options))
data = self.event_key_compiled_jmespath.search(
data,
options=jmespath.Options(**(self.jmespath_options or {})),
)

if self.is_missing_idempotency_key(data=data):
if self.raise_on_no_idempotency_key:
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/parameters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def get_transform_method(value: str, transform: TransformOptions = None) -> Call
transform_method = TRANSFORM_METHOD_MAPPING.get(transform)

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

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