Skip to content

Commit

Permalink
Merge pull request #158 from emcpow2/context-type-hinting
Browse files Browse the repository at this point in the history
AWS Lambda context type hinting
  • Loading branch information
koxudaxi authored Feb 26, 2021
2 parents 3c5894f + fe72ca7 commit 70f0750
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mangum/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from mangum.protocols.http import HTTPCycle
from mangum.exceptions import ConfigurationError

if typing.TYPE_CHECKING: # pragma: no cover
from awslambdaric.lambda_context import LambdaContext

DEFAULT_TEXT_MIME_TYPES = [
"application/json",
Expand Down Expand Up @@ -79,7 +81,7 @@ def __post_init__(self, text_mime_types: typing.Optional[typing.List[str]]) -> N
text_mime_types = DEFAULT_TEXT_MIME_TYPES
self.text_mime_types = text_mime_types

def __call__(self, event: dict, context: dict) -> dict:
def __call__(self, event: dict, context: "LambdaContext") -> dict:
self.logger.debug("Event received.")

with ExitStack() as stack:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ moto
mypy
brotli
brotli-asgi
awslambdaric-stubs
# Docs
mkdocs
mkdocs-material

0 comments on commit 70f0750

Please sign in to comment.