Skip to content

Commit 13b2900

Browse files
committed
some comments
1 parent db15e4c commit 13b2900

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
class DynamoDBStreamsProvider(DynamodbstreamsApi, ServiceLifecycleHook):
5252
shard_to_region: dict[str, str]
5353
"""Map a shard iterator to the originating region. This is used in case of replica tables, as LocalStack keeps the
54-
data in one region only, redirecting all the requests to replica regions."""
54+
data in one region only, redirecting all the requests from replica regions."""
5555

5656
def __init__(self):
5757
self.shard_to_region = {}

localstack-core/localstack/services/dynamodbstreams/v2/provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
class DynamoDBStreamsProvider(DynamodbstreamsApi, ServiceLifecycleHook):
2727
shard_to_region: dict[str, str]
2828
"""Map a shard iterator to the originating region. This is used in case of replica tables, as LocalStack keeps the
29-
data in one region only, redirecting all the requests to replica regions."""
29+
data in one region only, redirecting all the requests from replica regions."""
3030

3131
def __init__(self):
3232
self.server = DynamodbServer.get()

tests/aws/services/dynamodb/test_dynamodb.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,11 @@ def test_global_tables_version_2019(
11381138
assert "Replicas" not in response["Table"]
11391139

11401140
@markers.aws.validated
1141-
# The stream label on the replica and replicated stream are the same (while they differ on AWS).
1142-
# The region changes accordingly in the ARN. We test this with assertions.
1141+
# An ARM stream has a stream label as suffix. In AWS, such a label differs between the stream of the original table
1142+
# and the ones of the replicas. In LocalStack, it does not differ. The only difference in the stream ARNs is the
1143+
# region. Therefore, we skip the following paths from the snapshots.
1144+
# However, we run plain assertions to make sure that the region changes in the ARNs, i.e., the replica have their
1145+
# own stream.
11431146
@markers.snapshot.skip_snapshot_verify(
11441147
paths=["$..Streams..StreamArn", "$..Streams..StreamLabel"]
11451148
)
@@ -1193,14 +1196,6 @@ def test_streams_on_global_tables(
11931196
waiter = region_2_factory.dynamodb.get_waiter("table_exists")
11941197
waiter.wait(TableName=table_name, WaiterConfig={"Delay": WAIT_SEC, "MaxAttempts": 20})
11951198

1196-
with pytest.raises(ClientError):
1197-
region_2_factory.dynamodb.update_table(
1198-
TableName=table_name,
1199-
StreamSpecification=StreamSpecification(
1200-
StreamEnabled=True, StreamViewType=StreamViewType.NEW_AND_OLD_IMAGES
1201-
),
1202-
)
1203-
12041199
stream_arn_region = region_1_factory.dynamodb.describe_table(TableName=table_name)["Table"][
12051200
"LatestStreamArn"
12061201
]

0 commit comments

Comments
 (0)