Skip to content

adding data_as_bytes to KinesisStreamRecordPayload #617

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

Closed
hjurong opened this issue Aug 17, 2021 · 3 comments
Closed

adding data_as_bytes to KinesisStreamRecordPayload #617

hjurong opened this issue Aug 17, 2021 · 3 comments
Labels
feature-request feature request good first issue Good for newcomers help wanted Could use a second pair of eyes/hands p3

Comments

@hjurong
Copy link

hjurong commented Aug 17, 2021

Is your feature request related to a problem? Please describe.

currently the KinesisStreamRecordPayload has data_as_text and data_as_json helpers which are useful for deserialising text/json payload; however, we can have gzipped payload (e.g., from cloudwatch logs) which we don't want to convert to str but still want to leverage the dataclass to do the base64 decode

Describe the solution you'd like

a data_as_bytes method in KinesisStreamRecordPayload

Describe alternatives you've considered

Another custom wrapper class, or just getting the record.kinesis.data attribute then do the base64 decode; but both are not as clean as having a helper on KinesisStreamRecordPayload

Additional context

N/A

@hjurong hjurong added feature-request feature request triage Pending triage from maintainers labels Aug 17, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 17, 2021

Thanks for opening your first issue here! We'll come back to you as soon as we can.

@heitorlessa
Copy link
Contributor

Hey @hjurong thanks a lot for creating an issue!

Would you like to contribute this as a Pull Request? If so, we can guide you and make sure this is part of the next release we're working towards (1.20.0).

It'll require roughly 2 lines here: https://github.com/awslabs/aws-lambda-powertools-python/blob/474507000b648ff4439a68ed20ad463fcb669a27/aws_lambda_powertools/utilities/data_classes/kinesis_stream_event.py#L8

And an additional test like this to make sure it works as expected: https://github.com/awslabs/aws-lambda-powertools-python/blob/474507000b648ff4439a68ed20ad463fcb669a27/tests/functional/test_data_classes.py#L1083

Taking the triage off so we can take this later if you're out of bandwidth.

Thank you!!

@heitorlessa heitorlessa added good first issue Good for newcomers help wanted Could use a second pair of eyes/hands p3 and removed triage Pending triage from maintainers labels Aug 19, 2021
@heitorlessa
Copy link
Contributor

Coming in today's release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request good first issue Good for newcomers help wanted Could use a second pair of eyes/hands p3
Projects
None yet
Development

No branches or pull requests

2 participants