Skip to content

Commit 75e47d4

Browse files
fix: small changes
1 parent 75fec0a commit 75e47d4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

aws_lambda_powertools/utilities/idempotency/persistence/redis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ def _item_to_data_record(self, idempotency_key: str, item: dict[str, Any]) -> Da
332332
idempotency_key=idempotency_key,
333333
status=item[self.status_attr],
334334
in_progress_expiry_timestamp=in_progress_expiry_timestamp,
335-
response_data=item.get(self.data_attr),
336-
payload_hash=item.get(self.validation_key_attr),
335+
response_data=item.get(self.data_attr, ""),
336+
payload_hash=item.get(self.validation_key_attr, ""),
337337
expiry_timestamp=item.get("expiration"),
338338
)
339339

tests/functional/idempotency/_redis/test_redis_layer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def test_item_to_datarecord_conversion(valid_record):
333333
def test_item_to_datarecord_conversion_missing_optional_attributes(persistence_store_standalone_redis):
334334
"""
335335
When data_attr or validation_key_attr is missing from Redis,
336-
response_data and payload_hash should be None — not the string "None".
336+
response_data and payload_hash should be empty string, not the string "None".
337337
Regression test for: https://github.com/aws-powertools/powertools-lambda-python/issues/8090
338338
"""
339339
idempotency_key = "test-func#abc123"
@@ -345,8 +345,8 @@ def test_item_to_datarecord_conversion_missing_optional_attributes(persistence_s
345345

346346
record = persistence_store_standalone_redis._item_to_data_record(idempotency_key, item)
347347

348-
assert record.response_data is None
349-
assert record.payload_hash is None
348+
assert record.response_data == ""
349+
assert record.payload_hash == ""
350350

351351

352352
def test_idempotent_function_and_lambda_handler_redis_basic(

0 commit comments

Comments
 (0)