Skip to content

Commit b82db92

Browse files
author
Michael Brewer
committed
refactor: Clean up ifs
1 parent 038190c commit b82db92

File tree

1 file changed

+3
-6
lines changed
  • aws_lambda_powertools/utilities/idempotency/persistence

1 file changed

+3
-6
lines changed

aws_lambda_powertools/utilities/idempotency/persistence/base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,11 @@ def _get_hashed_idempotency_key(self, lambda_event: Dict[str, Any]) -> str:
183183

184184
@staticmethod
185185
def is_missing_idempotency_key(data) -> bool:
186-
if data is None:
186+
if data is None or not data:
187187
return True
188-
elif not data:
189-
return True
190-
elif type(data).__name__ in ("tuple", "list", "dict"):
188+
if type(data).__name__ in ("tuple", "list", "dict"):
191189
return all(x is None for x in data)
192-
else:
193-
return False
190+
return False
194191

195192
def _get_hashed_payload(self, lambda_event: Dict[str, Any]) -> str:
196193
"""

0 commit comments

Comments
 (0)