Skip to content

feat(event_source): Event source dataclasses for IoT Core Registry Events #6123

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

basvandriel
Copy link
Contributor

@basvandriel basvandriel commented Feb 18, 2025

Issue number: #6110

Summary

Changes

On top of the pydantic classes for the IoT registry events, this pull request also implements the event source dataclasses.

User experience

from aws_lambda_powertools.utilities.data_classes import event_source
from aws_lambda_powertools.utilities.data_classes.iot_registry_event import IoTCoreThingEvent


@event_source(data_class=IoTCoreThingEvent)
def lambda_handler(event: IoTCoreThingEvent, context):
    print(f"Received IoT Core event type {event.event_type}")

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.

@boring-cyborg boring-cyborg bot added the tests label Feb 18, 2025
@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 18, 2025
@basvandriel
Copy link
Contributor Author

basvandriel commented Feb 18, 2025

Closes #6110

@basvandriel basvandriel changed the title Event source dataclasses for IoT Core Registry Events feat(parser): Event source dataclasses for IoT Core Registry Events Feb 18, 2025
@leandrodamascena leandrodamascena self-requested a review February 19, 2025 09:11
@leandrodamascena leandrodamascena linked an issue Feb 19, 2025 that may be closed by this pull request
2 tasks
@github-actions github-actions bot added the feature New feature or functionality label Feb 19, 2025
Copy link
Contributor

No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.

@github-actions github-actions bot added do-not-merge need-issue PRs that are missing related issues labels Feb 19, 2025
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Feb 19, 2025
@basvandriel basvandriel marked this pull request as ready for review February 19, 2025 19:34
@basvandriel basvandriel requested a review from a team as a code owner February 19, 2025 19:34
@basvandriel
Copy link
Contributor Author

Hi @leandrodamascena, would you like me to add examples for every class? I already added the documentation headers, but was not sure to already implement them all since their quite identical.

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.

Hi @basvandriel! SUPER THANKS for another super PR! I just left some comments to adhere to this PEP.

If possible, please add a small example for each class. If you don't have time, please let me know that I can do this.

@basvandriel
Copy link
Contributor Author

Hi @basvandriel! SUPER THANKS for another super PR! I just left some comments to adhere to this PEP.

If possible, please add a small example for each class. If you don't have time, please let me know that I can do this.

Hi @leandrodamascena, will do! Thanks for the review. I'll try to find time to implement the examples this week.

@leandrodamascena leandrodamascena removed do-not-merge need-issue PRs that are missing related issues labels Feb 20, 2025
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Feb 20, 2025
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Feb 24, 2025
@leandrodamascena
Copy link
Contributor

Hey @basvandriel, thanks for accepting the suggestions and working to address them! I'm currently away from my computer, but I'll review everything tomorrow morning.

Everything looks good, but If any small changes are needed, I'll send a small commit and merge it. I'd like to include it in the release we're planning for tomorrow.

Thanks a lot for this another super PR! 🎉🎉👏👏

@basvandriel
Copy link
Contributor Author

Hi @leandrodamascena, again, sorry for the late reply. Feel free to review my latest changes, I've updated documentation and added examples as discussed. I had to commit your suggested changes manually, as GitHub wouldn't let me do it in the browser. Anyway - looking forward to your response!

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.25%. Comparing base (9ce2af6) to head (0fda7a5).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6123      +/-   ##
===========================================
+ Coverage    96.19%   96.25%   +0.05%     
===========================================
  Files          235      236       +1     
  Lines        11229    11399     +170     
  Branches       828      828              
===========================================
+ Hits         10802    10972     +170     
  Misses         337      337              
  Partials        90       90              

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

@leandrodamascena leandrodamascena self-requested a review February 25, 2025 10:02
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.

Hi @basvandriel! Thanks a lot for working on this PR! I just made some minor changes to the documentation and added all the fields to the test file to increase coverage.

APPROVED! This will be included in the release in the next few hours!

@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Feb 25, 2025
@leandrodamascena leandrodamascena merged commit 79d57d8 into aws-powertools:develop Feb 25, 2025
13 checks passed
@leandrodamascena leandrodamascena changed the title feat(parser): Event source dataclasses for IoT Core Registry Events feat(event_source): Event source dataclasses for IoT Core Registry Events Feb 25, 2025
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature New feature or functionality size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Missing event source classes for IoT Core events
3 participants