add typing to aiokafka/cluster.py#1024
Conversation
| def send(self, request, expect_response=True): | ||
| @overload | ||
| def send(self, request: Request[ResponseT]) -> Coroutine[None, None, ResponseT]: ... | ||
| @overload |
Check notice
Code scanning / CodeQL
Statement has no effect
| def send( | ||
| self, request: Request[ResponseT], expect_response: Literal[False] | ||
| ) -> Coroutine[None, None, None]: ... | ||
| @overload |
Check notice
Code scanning / CodeQL
Statement has no effect
| def _send_sasl_token( | ||
| self, payload: bytes, expect_response: Literal[False] | ||
| ) -> Coroutine[None, None, None]: ... | ||
| @overload |
Check notice
Code scanning / CodeQL
Statement has no effect
| def _send_sasl_token( | ||
| self, payload: bytes, expect_response: bool | ||
| ) -> Union[Coroutine[None, None, None], Coroutine[None, None, bytes]]: ... | ||
|
|
Check notice
Code scanning / CodeQL
Statement has no effect
| def _send_sasl_token( | ||
| self, payload: bytes, expect_response: Literal[True] | ||
| ) -> Coroutine[None, None, bytes]: ... | ||
| @overload |
Check notice
Code scanning / CodeQL
Statement has no effect
| ) -> Coroutine[None, None, bytes]: ... | ||
| @overload | ||
| def _send_sasl_token(self, payload: bytes) -> Coroutine[None, None, bytes]: ... | ||
| @overload |
Check notice
Code scanning / CodeQL
Statement has no effect
| if TYPE_CHECKING: | ||
| from aiokafka.client import CoordinationType |
There was a problem hiding this comment.
What do you think about moving ConnectionGroup and CoordinationType to structs.py instead? Also, I see that they just namespace classes, so it's meaningless to use them in type declarations. Probably we need to make them enums?
There was a problem hiding this comment.
Alternatively, create aiokafka/enums.py for common enums.
Changes
Fixes #
Checklist
CHANGESfolder<issue_id>.<type>(e.g.588.bugfix)issue_idchange it to the pr id after creating the PR.feature: Signifying a new feature..bugfix: Signifying a bug fix..doc: Signifying a documentation improvement..removal: Signifying a deprecation or removal of public API..misc: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.