Skip to content

feat(event_source): decode nested messages on SQS events #2349

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

Merged
merged 8 commits into from
Jun 30, 2023

Conversation

rafaelgsr
Copy link
Contributor

@rafaelgsr rafaelgsr commented May 31, 2023

Issue number: #2348

Summary

Changes

Adding decode_nested_s3_event and decode_nested_sns_event functions on SQSEvent to decode nested events originated from S3 and SNS, respectively.

User experience

@event_source(data_class=SQSEvent)
def lambda_handler(event: SQSEvent, context):
     for record in event.records:
        nested_event: S3Event = record.decoded_nested_s3_event

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@rafaelgsr rafaelgsr requested a review from a team as a code owner May 31, 2023 17:05
@rafaelgsr rafaelgsr requested review from rubenfonseca and removed request for a team May 31, 2023 17:05
@boring-cyborg boring-cyborg bot added the tests label May 31, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented May 31, 2023

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 31, 2023
@leandrodamascena leandrodamascena linked an issue May 31, 2023 that may be closed by this pull request
2 tasks
@leandrodamascena leandrodamascena requested review from leandrodamascena and removed request for rubenfonseca June 1, 2023 10:21
@rubenfonseca
Copy link
Contributor

@leandrodamascena @rafaelgsr what's the status of this PR? What's needed?

@rubenfonseca rubenfonseca added the event_sources Event Source Data Class utility label Jun 15, 2023
@github-actions github-actions bot added the feature New feature or functionality label Jun 16, 2023
@heitorlessa
Copy link
Contributor

reiterating the ask @leandrodamascena @rafaelgsr before we take over

@rafaelgsr
Copy link
Contributor Author

@heitorlessa @rubenfonseca hey folks, sorry my delayed response. I was on vacations and then on a business trip. I'll resume working on this next week and come up with a proposal based on what @cowsandmilk mentioned.

@rubenfonseca rubenfonseca added the revisit Maintainer to provide update or revisit prioritization in the next cycle label Jun 26, 2023
@rafaelgsr rafaelgsr requested a review from a team June 30, 2023 08:56
@boring-cyborg boring-cyborg bot added github-actions Pull requests that update Github_actions code github-templates labels Jun 30, 2023
@pull-request-size pull-request-size bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 30, 2023
@pull-request-size pull-request-size bot removed the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 30, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (a7e23dd) 97.23% compared to head (a2c7d39) 97.23%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2349   +/-   ##
========================================
  Coverage    97.23%   97.23%           
========================================
  Files          161      161           
  Lines         7415     7426   +11     
  Branches       538      538           
========================================
+ Hits          7210     7221   +11     
  Misses         158      158           
  Partials        47       47           
Impacted Files Coverage Δ
...bda_powertools/utilities/data_classes/sns_event.py 100.00% <100.00%> (ø)
...bda_powertools/utilities/data_classes/sqs_event.py 98.97% <100.00%> (+0.12%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

…, decoded_nested_sns_event instead of decode_nested_sns_event)
@rubenfonseca rubenfonseca changed the title feat(event_source): Add function to decode nested messages on SQS events feat(event_source): decode nested messages on SQS events Jun 30, 2023
Copy link
Contributor

@rubenfonseca rubenfonseca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you @rafaelgsr !

@rubenfonseca rubenfonseca merged commit 58e610c into aws-powertools:develop Jun 30, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 30, 2023

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@rubenfonseca rubenfonseca removed github-actions Pull requests that update Github_actions code github-templates revisit Maintainer to provide update or revisit prioritization in the next cycle labels Jun 30, 2023
@rafaelgsr rafaelgsr deleted the feat/2348 branch June 30, 2023 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event_sources Event Source Data Class utility feature New feature or functionality size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Add function to decode nested messages on SQS events
6 participants