python-keycloak
python-keycloak copied to clipboard
Wrong typehints for raw post/get methods of KeycloakOpenIDConnection
After update I catched strange mypy errors
src\keycloak_migrator\keycloak_facade.py:89: error: Argument 1 to "raw_post" of "KeycloakOpenIDConnection" has incompatible type "str"; expected "list[Any]" [arg-type]
src\keycloak_migrator\keycloak_facade.py:90: error: Argument "data" to "raw_post" of "KeycloakOpenIDConnection" has incompatible type "str"; expected "dict[Any, Any]" [arg-type]
src\keycloak_migrator\keycloak_facade.py:94: error: Argument 2 to "raise_error_from_response" has incompatible type "type[KeycloakPostError]"; expected "dict[Any, Any] | Exception" [arg-type]
src\keycloak_migrator\keycloak_facade.py:306: error: Argument "audience" to "token" of "KeycloakOpenID" has incompatible type "str"; expected "dict[Any, Any]" [arg-type]
Found 4 errors in 1 file (checked 37 source files)
I think sombody made wrong typehints. args is tuple but not a list. But its really bad idea of typyhinting args/kwargs, as they are abstractions for passing params through, so there should not be typehints. What are the purpose of this typehinting?
I've also seen plenty of these as Pyright warnings while developing. Sounds like you may be right about not typing kwargs. I see these type of warnings everywhere in the repo