Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): kinesis sequence number is str, not int #907

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions aws_lambda_powertools/utilities/parser/models/kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import List, Union

from pydantic import BaseModel, validator
from pydantic.types import PositiveInt

from aws_lambda_powertools.utilities.parser.types import Literal, Model

Expand All @@ -14,7 +13,7 @@
class KinesisDataStreamRecordPayload(BaseModel):
kinesisSchemaVersion: str
partitionKey: str
sequenceNumber: PositiveInt
sequenceNumber: str
data: Union[bytes, Model] # base64 encoded str is parsed into bytes
approximateArrivalTimestamp: float

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/parser/test_kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def handle_kinesis_no_envelope(event: KinesisDataStreamModel, _: LambdaContext):
assert kinesis.approximateArrivalTimestamp == 1545084650.987
assert kinesis.kinesisSchemaVersion == "1.0"
assert kinesis.partitionKey == "1"
assert kinesis.sequenceNumber == 49590338271490256608559692538361571095921575989136588898
assert kinesis.sequenceNumber == "49590338271490256608559692538361571095921575989136588898"
assert kinesis.data == b"Hello, this is a test."


Expand Down