Skip to content

feat(event_handler): adding resolve async public API#8171

Draft
leandrodamascena wants to merge 1 commit intodevelopfrom
feature/8137-resolve-async-public
Draft

feat(event_handler): adding resolve async public API#8171
leandrodamascena wants to merge 1 commit intodevelopfrom
feature/8137-resolve-async-public

Conversation

@leandrodamascena
Copy link
Copy Markdown
Contributor

Issue number: closes #8137

Changes

Add public resolve_async(event, context) method to ApiGatewayResolver. All resolvers inherit it automatically (APIGatewayRestResolver, APIGatewayHttpResolver, ALBResolver, etc).

User experience

import asyncio                                                                                                                                          
from aws_lambda_powertools.event_handler import APIGatewayHttpResolver                                                                                  
                                                                                                                                                        
app = APIGatewayHttpResolver()                                                                                   
                                                                                                                                                        
@app.get("/dashboard/<user_id>")                                                                                                                        
async def get_dashboard(user_id: str):                                                                                                                  
    orders, profile = await asyncio.gather(                                                                                                             
        get_orders(user_id),                                                                                     
        get_profile(user_id),                                                                                                                           
    )                                                                                                                                                   
    return {"orders": orders, "profile": profile}                                                                                                       
                                                                                                                                                        
def lambda_handler(event, context):                                                                                                                     
    return asyncio.run(app.resolve_async(event, context))

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.

@leandrodamascena leandrodamascena requested a review from a team as a code owner April 24, 2026 15:19
@boring-cyborg boring-cyborg Bot added documentation Improvements or additions to documentation event_handlers tests labels Apr 24, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 24, 2026
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.70%. Comparing base (3c588e9) to head (ac6f08c).

Files with missing lines Patch % Lines
aws_lambda_powertools/event_handler/api_gateway.py 81.25% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8171      +/-   ##
===========================================
- Coverage    96.71%   96.70%   -0.02%     
===========================================
  Files          286      286              
  Lines        14325    14341      +16     
  Branches      1197     1200       +3     
===========================================
+ Hits         13855    13868      +13     
- Misses         341      343       +2     
- Partials       129      130       +1     

☔ 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.

@leandrodamascena leandrodamascena marked this pull request as draft April 24, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge documentation Improvements or additions to documentation event_handlers 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: add resolve_async() public method for async handler support

1 participant