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_kwargsfrom adapter and handler constructors in favor of an explicitapi_gateway_base_pathparameter (the only parameterhandler_kwargscould have)ContextManagertyping onlifespan_cyclein adapter.pyBaseRequest.scopeto a property (formerly a function) for consistency with child classesScope, being aMutableMappingtechnically has no.copy()as part of its protocol (collections generally don't). Usingcopy.copy()inprotocols.websockets.run()to reflect thatCloses #201