-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
mypy - Argument "api_gateway_base_path" to "Mangum" has incompatible type "str"; expected "Dict[str, Any]" #220
Conversation
…anged `BaseRequest.scope` to a property (formerly a method) for consistency with child classes;
Thanks @relsunkaev, I think this is good to merge. Before I do, I wanted to see if you might also remove the If you're not sure about what I mean about the |
Yeah, I noticed the same thing but didn't look further into it since I didn't know if there was something planned for that. I'll add it to the PR. |
@relsunkaev thanks. I added a comment to the (now closed) issue here discussing the There is likely some more work to be done beyond just removing |
`api_gateway_base_path` is now an explict param; Fixed two exception entries on lifespan config; Added test for default `api_gateway_base_path` value;
Just updated my PR with the changes. |
Created `QueryParams` TypeAlias in `types.py`; `api_gateway_base_path` is now a positional arg in handlers; Fixed tests to reflect the above; Made imports consistent to use `from`; Cleaned up some code to make Pylance happy; Fixed setting InitVar in `WebSocket`;
@relsunkaev looks good, thanks! |
…#220) * Fixed typing in adapter.py; Added more explicit types some places; Changed `BaseRequest.scope` to a property (formerly a method) for consistency with child classes; * Removed `handler_kwargs`; `api_gateway_base_path` is now an explict param; Fixed two exception entries on lifespan config; Added test for default `api_gateway_base_path` value; * Fixed `AwsApiGateway` missing default for `api_gateway_base_path`; * Added `api_gateway_base_path` param in `test_abstract_handler`; * Removed `Optional` import from `abstract_handler`; * Removed class attributes from `Mangum`; Created `QueryParams` TypeAlias in `types.py`; `api_gateway_base_path` is now a positional arg in handlers; Fixed tests to reflect the above; Made imports consistent to use `from`; Cleaned up some code to make Pylance happy; Fixed setting InitVar in `WebSocket`; * Fixed linting error; * Fixed coverage; * Removed unused import; Co-authored-by: Ramazan Elsunkaev <ramazan@up-linq.com>
handler_kwargs
from adapter and handler constructors in favor of an explicitapi_gateway_base_path
parameter (the only parameterhandler_kwargs
could have)ContextManager
typing onlifespan_cycle
in adapter.pyBaseRequest.scope
to a property (formerly a function) for consistency with child classesScope
, being aMutableMapping
technically has no.copy()
as part of its protocol (collections generally don't). Usingcopy.copy()
inprotocols.websockets.run()
to reflect thatCloses #201