aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.67k stars 1.01k forks source link

Typing for `BaseLambdaEvent.context` should be `LambdaContext` instead of dict #1843

Open ocxyz opened 2 years ago

ocxyz commented 2 years ago

The context attribute does not match the implementation and docs.

https://github.com/aws/chalice/blob/a7a96df5809bc37a2174687f55760cdedcdc3ed6/chalice/app.pyi#L486-L490

Should be chalice.local.LambdaContext instead of dict.

Example docs: https://aws.github.io/chalice/api.html?highlight=snsevent#SQSEvent.context

jamesls commented 2 years ago

Thanks for reporting. We should probably move the definition to app.pyi so we don't have a dependency from chalice.app -> chalice.local.