Skip to content

feat(apigateway): introduce specialized routers for typing #1824

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

Conversation

rubenfonseca
Copy link
Contributor

@rubenfonseca rubenfonseca commented Jan 10, 2023

Issue number: #1781

Summary

Changes

Please provide a summary of what's being changed

This PR implements the following changes:

  • Introduces specialized Router classes
  • Reorganizes classes into a new router.py file
  • Adds tests for new code
  • Updates documentation

User experience

Please share what the user experience looks like before and after this change

Before the change, you would not get type hints from your IDE when accessing the current_event property of your splitted router.

After this change, you can use a specialized router for each kind of event source, and get access to the specialized events:

carbon (31)

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 documentation Improvements or additions to documentation event_handlers tests labels Jan 10, 2023
@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 10, 2023
@github-actions github-actions bot added the feature New feature or functionality label Jan 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2023

Codecov Report

Base: 97.59% // Head: 97.59% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (482263d) compared to base (788f39b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1824   +/-   ##
========================================
  Coverage    97.59%   97.59%           
========================================
  Files          141      142    +1     
  Lines         6434     6444   +10     
  Branches       444      444           
========================================
+ Hits          6279     6289   +10     
  Misses         123      123           
  Partials        32       32           
Impacted Files Coverage Δ
aws_lambda_powertools/event_handler/router.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 10, 2023
@rubenfonseca rubenfonseca marked this pull request as ready for review January 10, 2023 12:47
@rubenfonseca rubenfonseca requested a review from a team as a code owner January 10, 2023 12:47
@rubenfonseca rubenfonseca requested review from heitorlessa and leandrodamascena and removed request for a team January 10, 2023 12:47
@leandrodamascena leandrodamascena changed the title feat: introduce specialized routers for typing (feat): introduce specialized routers for typing Jan 11, 2023
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.

Hello @rubenfonseca! Another incredible PR! Everything worked as expected here and I just added more details in the example just to make sure the user has a full example of use.

@leandrodamascena leandrodamascena merged commit 73cfd9b into aws-powertools:develop Jan 11, 2023
@rubenfonseca rubenfonseca deleted the feat/specialized-routers branch January 11, 2023 15:40
@heitorlessa heitorlessa changed the title (feat): introduce specialized routers for typing feat(apigateway): introduce specialized routers for typing Feb 9, 2023
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 event_handlers 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: introduce ALBRouter, etc. to set the type of current_event in the REST API Router
3 participants