Skip to content
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/conn.py #1021

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ DOCKER_IMAGE=aiolibs/kafka:$(SCALA_VERSION)_$(KAFKA_VERSION)
DIFF_BRANCH=origin/master
FORMATTED_AREAS=\
aiokafka/codec.py \
aiokafka/conn.py \
dimastbk marked this conversation as resolved.
Show resolved Hide resolved
aiokafka/coordinator/ \
aiokafka/errors.py \
aiokafka/helpers.py \
Expand All @@ -15,6 +16,7 @@ FORMATTED_AREAS=\
aiokafka/protocol/ \
aiokafka/record/ \
tests/test_codec.py \
tests/test_conn.py \
tests/test_helpers.py \
tests/test_protocol.py \
tests/test_protocol_object_conversion.py \
Expand Down
5 changes: 3 additions & 2 deletions aiokafka/abc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import abc
from typing import Dict


class ConsumerRebalanceListener(abc.ABC):
Expand Down Expand Up @@ -103,7 +104,7 @@ class AbstractTokenProvider(abc.ABC):
"""

@abc.abstractmethod
async def token(self):
async def token(self) -> str:
"""
An async callback returning a :class:`str` ID/Access Token to be sent to
the Kafka client. In case where a synchronous callback is needed,
Expand All @@ -122,7 +123,7 @@ def _token(self):
# The actual synchronous token callback.
"""

def extensions(self):
def extensions(self) -> Dict[str, str]:
"""
This is an OPTIONAL method that may be implemented.

Expand Down
Loading
Loading