Skip to content

feat(event_source): export SQSRecord in data_classes module #6639

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

Conversation

AlisonVilela
Copy link
Contributor

Issue number: #6637

Summary

Changes

Export SQSRecord class in the main aws_lambda_powertools.utilities.data_classes module to allow for more consistent import patterns when working with SQS events.

User experience

Before:
Developers need to use inconsistent import patterns:

from aws_lambda_powertools.utilities.data_classes import SQSEvent
from aws_lambda_powertools.utilities.data_classes.sqs_event import SQSRecord

After:
Developers can use a single, consistent import pattern:

from aws_lambda_powertools.utilities.data_classes import SQSEvent, SQSRecord

This improves developer experience by providing a more intuitive API when working with SQS events.

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.

@AlisonVilela AlisonVilela requested a review from a team as a code owner May 9, 2025 08:40
@AlisonVilela AlisonVilela requested a review from anafalcao May 9, 2025 08:40
Copy link

boring-cyborg bot commented May 9, 2025

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/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 9, 2025
@AlisonVilela
Copy link
Contributor Author

This doesn't fix a bug, as developers can already import SQSRecord directly from the submodule. The intent is simply to make the API more consistent and intuitive by allowing SQSEvent and SQSRecord to be imported from the same place, which aligns with how other event types are handled in the library.

@leandrodamascena leandrodamascena changed the title feat: Export SQSRecord in data_classes module feat(event_source): export SQSRecord in data_classes module May 12, 2025
@leandrodamascena leandrodamascena linked an issue May 12, 2025 that may be closed by this pull request
@github-actions github-actions bot added the feature New feature or functionality label May 12, 2025
Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.12%. Comparing base (d00c6a1) to head (113d726).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6639   +/-   ##
========================================
  Coverage    96.12%   96.12%           
========================================
  Files          253      253           
  Lines        12104    12104           
  Branches       902      902           
========================================
  Hits         11635    11635           
  Misses         369      369           
  Partials       100      100           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Thanks for improving this experience @AlisonVilela! Approving!

@leandrodamascena
Copy link
Contributor

Obrigado 🇧🇷

@leandrodamascena leandrodamascena merged commit 03a98a2 into aws-powertools:develop May 12, 2025
12 checks passed
Copy link

boring-cyborg bot commented May 12, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Export SQSRecord in main data_classes module
2 participants