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

Commit 4cc822a

Browse files
committed
PR comments
1 parent 381be84 commit 4cc822a

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,11 @@ def forward_to_kinesis_stream(
274274
table_arn = arns.dynamodb_table_arn(table_name, account_id, region_name)
275275
records = table_records["records"]
276276
table_def = store.table_definitions.get(table_name) or {}
277-
destinations = store.streaming_destinations.get(table_name) or []
277+
destinations = store.streaming_destinations.get(table_name)
278+
if not destinations:
279+
LOG.debug("Table %s has no Kinesis streaming destinations enabled", table_name)
280+
continue
281+
278282
stream_arn = destinations[-1]["StreamArn"]
279283
for record in records:
280284
kinesis_record = dict(

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from localstack.services.dynamodb.v2.provider import DynamoDBProvider
1717
from localstack.services.dynamodbstreams.models import (
1818
DynamoDbStreamsStore,
19-
Stream,
19+
StreamWrapper,
2020
dynamodbstreams_stores,
2121
)
2222
from localstack.utils.aws import arns, resources
@@ -89,7 +89,7 @@ def add_dynamodb_stream(
8989
Shards=[],
9090
StreamViewType=view_type,
9191
)
92-
store.ddb_streams[table_name] = Stream(StreamDescription=stream)
92+
store.ddb_streams[table_name] = StreamWrapper(StreamDescription=stream)
9393

9494

9595
def get_stream_for_table(
@@ -219,7 +219,7 @@ def kinesis_shard_id(dynamodbstream_shard_id: str) -> str:
219219
return f"{shard_params[0]}-{shard_params[-1]}"
220220

221221

222-
def get_shard_id(stream: Stream, kinesis_shard_id: str) -> str:
222+
def get_shard_id(stream: StreamWrapper, kinesis_shard_id: str) -> str:
223223
ddb_stream_shard_id = stream.shards_id_map.get(kinesis_shard_id)
224224
if not ddb_stream_shard_id:
225225
ddb_stream_shard_id = shard_id(kinesis_shard_id)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66

77
@dataclasses.dataclass
8-
class Stream:
8+
class StreamWrapper:
99
"""Wrapper for the API stub and additional information about a store"""
1010

1111
StreamDescription: StreamDescription
1212
shards_id_map: dict[str, str] = dataclasses.field(default_factory=dict)
1313

1414

1515
class DynamoDbStreamsStore(BaseStore):
16-
ddb_streams: dict[str, Stream] = LocalAttribute(default=dict)
16+
ddb_streams: dict[str, StreamWrapper] = LocalAttribute(default=dict)
1717

1818

1919
dynamodbstreams_stores = AccountRegionBundle("dynamodbstreams", DynamoDbStreamsStore)

0 commit comments

Comments
 (0)