Closed
Description
Static type checker used
pyright/pylance
AWS Lambda function runtime
3.12
Powertools for AWS Lambda (Python) version
latest
Static type checker info
The ApiGatewayResolver.resolve
function definition provides type annotations for the returning value, but not for the arguments:
def resolve(self, event, context) -> dict[str, Any]:
Parameters are described inside the function in the docstring, but not incorporated into the function definition:
Parameters
----------
event: dict[str, Any]
Event
context: LambdaContext
Lambda context
Returns
-------
dict
Returns the dict response
"""
Link to the line of code:
https://github.com/aws-powertools/powertools-lambda-python/blob/develop/aws_lambda_powertools/event_handler/api_gateway.py#L2002
Code snippet
def resolve(
event: Unknown,
context: Unknown
) -> dict[str, Any]
Possible Solution
Add the annotations to the function definition in addition to adding them into the doc string.
Metadata
Metadata
Assignees
Type
Projects
Status
Shipped
Activity
resolve
function #5602rafrafek commentedon Nov 20, 2024
Addressed in my PR #5602
github-actions commentedon Nov 21, 2024
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.