-
Notifications
You must be signed in to change notification settings - Fork 234
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
add typing to aiokafka/cluster.py #1024
base: master
Are you sure you want to change the base?
Conversation
return self._port | ||
|
||
def send(self, request, expect_response=True): | ||
@overload | ||
def send(self, request: Request[ResponseT]) -> Coroutine[None, None, ResponseT]: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
@overload | ||
def send( | ||
self, request: Request[ResponseT], expect_response: Literal[False] | ||
) -> Coroutine[None, None, None]: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
@overload | ||
def _send_sasl_token( | ||
self, payload: bytes, expect_response: Literal[False] | ||
) -> Coroutine[None, None, None]: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
@overload | ||
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 Note
@overload | ||
def _send_sasl_token( | ||
self, payload: bytes, expect_response: Literal[True] | ||
) -> Coroutine[None, None, bytes]: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
self, payload: bytes, expect_response: Literal[True] | ||
) -> Coroutine[None, None, bytes]: ... | ||
@overload | ||
def _send_sasl_token(self, payload: bytes) -> Coroutine[None, None, bytes]: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
if TYPE_CHECKING: | ||
from aiokafka.client import CoordinationType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, create aiokafka/enums.py
for common enums.
Changes
Fixes #
Checklist
CHANGES
folder<issue_id>.<type>
(e.g.588.bugfix
)issue_id
change 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.