Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit 18d8d32

Browse files
Transform leftover field
1 parent 1025ccf commit 18d8d32

4 files changed

Lines changed: 27 additions & 16 deletions

File tree

localstack-core/localstack/services/dynamodb/provider.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,12 @@ def describe_table(
853853
# Set defaults for warm throughput
854854
if "WarmThroughput" not in table_description:
855855
table_description["WarmThroughput"] = {
856-
"ReadUnitsPerSecond": 5,
857-
"WriteUnitsPerSecond": 5,
856+
"ReadUnitsPerSecond": 12000
857+
if table_definitions.get("BillingMode") == "PAY_PER_REQUEST"
858+
else 5,
859+
"WriteUnitsPerSecond": 4000
860+
if table_definitions.get("BillingMode") == "PAY_PER_REQUEST"
861+
else 5,
858862
}
859863
table_description["WarmThroughput"]["Status"] = (
860864
table_description.get("TableStatus") or "ACTIVE"

tests/aws/services/dynamodb/test_dynamodb.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,6 +2020,8 @@ def test_dynamodb_create_table_with_sse_specification(
20202020
def test_dynamodb_create_table_with_partial_sse_specification(
20212021
self, dynamodb_create_table_with_parameters, snapshot, aws_client
20222022
):
2023+
snapshot.add_transformer(TransformerUtility.key_value("CurrentKeyMaterialId"))
2024+
20232025
table_name = f"test_table_{short_uid()}"
20242026
sse_specification = {"Enabled": True}
20252027

@@ -2052,6 +2054,8 @@ def test_dynamodb_create_table_with_partial_sse_specification(
20522054
def test_dynamodb_update_table_without_sse_specification_change(
20532055
self, dynamodb_create_table_with_parameters, snapshot, aws_client
20542056
):
2057+
snapshot.add_transformer(TransformerUtility.key_value("CurrentKeyMaterialId"))
2058+
20552059
table_name = f"test_table_{short_uid()}"
20562060

20572061
sse_specification = {"Enabled": True}
@@ -2354,6 +2358,7 @@ def test_data_encoding_consistency(
23542358
paths=[
23552359
"$..PointInTimeRecoveryDescription..EarliestRestorableDateTime",
23562360
"$..PointInTimeRecoveryDescription..LatestRestorableDateTime",
2361+
"$..ContinuousBackupsDescription.PointInTimeRecoveryDescription.RecoveryPeriodInDays",
23572362
]
23582363
)
23592364
@markers.aws.validated
@@ -2708,6 +2713,8 @@ def _get_records_amount(record_amount: int):
27082713
@pytest.mark.parametrize("billing_mode", ["PAY_PER_REQUEST", "PROVISIONED"])
27092714
@markers.snapshot.skip_snapshot_verify(
27102715
paths=[
2716+
# Warm throughput for GSI is not implemented in LS. DDB Local doesn't support it either.
2717+
"$..Table.GlobalSecondaryIndexes..WarmThroughput",
27112718
# LS returns those and not AWS, probably because no changes happened there yet
27122719
"$..ProvisionedThroughput.LastDecreaseDateTime",
27132720
"$..ProvisionedThroughput.LastIncreaseDateTime",

tests/aws/services/dynamodb/test_dynamodb.snapshot.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
}
266266
},
267267
"tests/aws/services/dynamodb/test_dynamodb.py::TestDynamoDB::test_dynamodb_create_table_with_partial_sse_specification": {
268-
"recorded-date": "08-10-2025, 12:36:26",
268+
"recorded-date": "08-10-2025, 14:03:41",
269269
"recorded-content": {
270270
"SSEDescription": {
271271
"KMSMasterKeyArn": "arn:<partition>:kms:<region>:111111111111:key/<uuid:1>",
@@ -277,7 +277,7 @@
277277
"AWSAccountId": "111111111111",
278278
"Arn": "arn:<partition>:kms:<region>:111111111111:key/<uuid:1>",
279279
"CreationDate": "datetime",
280-
"CurrentKeyMaterialId": "1b4269cfeeadcdb4e8151d806b48655732cec33e3b85bbaf8f0941c15dd2f1e7",
280+
"CurrentKeyMaterialId": "<current-key-material-id:1>",
281281
"CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
282282
"Description": "Default key that protects my DynamoDB data when no other key is defined",
283283
"Enabled": true,
@@ -1422,7 +1422,7 @@
14221422
}
14231423
},
14241424
"tests/aws/services/dynamodb/test_dynamodb.py::TestDynamoDB::test_dynamodb_update_table_without_sse_specification_change": {
1425-
"recorded-date": "08-10-2025, 12:37:15",
1425+
"recorded-date": "08-10-2025, 14:06:57",
14261426
"recorded-content": {
14271427
"create_table_sse_description": {
14281428
"KMSMasterKeyArn": "arn:<partition>:kms:<region>:111111111111:key/<uuid:1>",
@@ -1434,7 +1434,7 @@
14341434
"AWSAccountId": "111111111111",
14351435
"Arn": "arn:<partition>:kms:<region>:111111111111:key/<uuid:1>",
14361436
"CreationDate": "datetime",
1437-
"CurrentKeyMaterialId": "1b4269cfeeadcdb4e8151d806b48655732cec33e3b85bbaf8f0941c15dd2f1e7",
1437+
"CurrentKeyMaterialId": "<current-key-material-id:1>",
14381438
"CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
14391439
"Description": "Default key that protects my DynamoDB data when no other key is defined",
14401440
"Enabled": true,

tests/aws/services/dynamodb/test_dynamodb.validation.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@
8181
}
8282
},
8383
"tests/aws/services/dynamodb/test_dynamodb.py::TestDynamoDB::test_dynamodb_create_table_with_partial_sse_specification": {
84-
"last_validated_date": "2025-10-08T12:36:26+00:00",
84+
"last_validated_date": "2025-10-08T14:03:41+00:00",
8585
"durations_in_seconds": {
86-
"setup": 0.0,
87-
"call": 5.82,
88-
"teardown": 0.31,
89-
"total": 6.13
86+
"setup": 0.67,
87+
"call": 7.68,
88+
"teardown": 0.3,
89+
"total": 8.65
9090
}
9191
},
9292
"tests/aws/services/dynamodb/test_dynamodb.py::TestDynamoDB::test_dynamodb_describe_contributor_insights": {
@@ -174,12 +174,12 @@
174174
}
175175
},
176176
"tests/aws/services/dynamodb/test_dynamodb.py::TestDynamoDB::test_dynamodb_update_table_without_sse_specification_change": {
177-
"last_validated_date": "2025-10-08T12:37:15+00:00",
177+
"last_validated_date": "2025-10-08T14:06:57+00:00",
178178
"durations_in_seconds": {
179-
"setup": 0.0,
180-
"call": 5.86,
181-
"teardown": 43.63,
182-
"total": 49.49
179+
"setup": 0.77,
180+
"call": 7.22,
181+
"teardown": 39.29,
182+
"total": 47.28
183183
}
184184
},
185185
"tests/aws/services/dynamodb/test_dynamodb.py::TestDynamoDB::test_empty_and_binary_values": {

0 commit comments

Comments
 (0)