Skip to content

Commit 5a2a3f8

Browse files
authored
fix ESM analytics (#11961)
1 parent 892eb4d commit 5a2a3f8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

localstack-core/localstack/services/lambda_/event_source_mapping/esm_event_processor.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@ def __init__(self, sender, logger):
2828
self.sender = sender
2929
self.logger = logger
3030

31-
def process_events_batch(self, input_events: list[dict]) -> None:
31+
def process_events_batch(self, input_events: list[dict] | dict) -> None:
3232
# analytics
33-
first_event = input_events[0] if input_events else {}
33+
if isinstance(input_events, list) and input_events:
34+
first_event = input_events[0]
35+
elif input_events:
36+
first_event = input_events
37+
else:
38+
first_event = {}
3439
event_source = first_event.get("eventSource")
3540
esm_invocation.record(event_source)
3641

0 commit comments

Comments
 (0)