Skip to content

Commit

Permalink
add typing to aiokafka/conn.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dimastbk committed Jun 30, 2024
1 parent b861a26 commit 2fe0965
Show file tree
Hide file tree
Showing 5 changed files with 317 additions and 145 deletions.
1 change: 1 addition & 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 \
aiokafka/coordinator/ \
aiokafka/errors.py \
aiokafka/helpers.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

0 comments on commit 2fe0965

Please sign in to comment.