Skip to content

Commit cdbd203

Browse files
committed
fix
1 parent d536a71 commit cdbd203

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

src/confluent_kafka/admin/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,7 @@ def list_topics(self, *args: Any, **kwargs: Any) -> ClusterMetadata:
652652

653653
return super(AdminClient, self).list_topics(*args, **kwargs)
654654

655-
def list_groups(self, *args: Any, **kwargs: Any) -> GroupMetadata:
656-
655+
def list_groups(self, *args: Any, **kwargs: Any) -> List[GroupMetadata]:
657656
return super(AdminClient, self).list_groups(*args, **kwargs)
658657

659658
def create_partitions( # type: ignore[override]

src/confluent_kafka/admin/_metadata.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Dict, List
15+
from typing import Dict, List, Optional
16+
17+
from confluent_kafka.cimpl import KafkaError
1618

1719

1820
class ClusterMetadata(object):

src/confluent_kafka/cimpl.pyi

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ from typing import Any, Optional, Callable, List, Tuple, Dict, Union, overload
3838
from typing_extensions import Self, Literal
3939
import builtins
4040

41+
from confluent_kafka.admin._metadata import ClusterMetadata, GroupMetadata
42+
4143
from ._types import HeadersType
4244

4345
# Callback types with proper class references (defined locally to avoid circular imports)
@@ -199,6 +201,11 @@ class Consumer:
199201
message: Optional['Message'] = None,
200202
offsets: Optional[List[TopicPartition]] = None
201203
) -> None: ...
204+
def committed(
205+
self,
206+
partitions: List[TopicPartition],
207+
timeout: float = -1
208+
) -> List[TopicPartition]: ...
202209
def close(self) -> None: ...
203210
def list_topics(self, topic: Optional[str] = None, timeout: float = -1) -> Any: ...
204211
def offsets_for_times(
@@ -255,12 +262,12 @@ class _AdminClientImpl:
255262
self,
256263
topic: Optional[str] = None,
257264
timeout: float = -1
258-
) -> Any: ...
265+
) -> ClusterMetadata: ...
259266
def list_groups(
260267
self,
261268
group: Optional[str] = None,
262269
timeout: float = -1
263-
) -> Any: ...
270+
) -> List[GroupMetadata]: ...
264271
def describe_consumer_groups(
265272
self,
266273
group_ids: List[str],

src/confluent_kafka/experimental/aio/_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(
3232
self.logger = logger
3333

3434
def log(self, *args: Any, **kwargs: Any) -> None:
35-
self.loop.call_soon_threadsafe(self.logger.log, *args, **kwargs)
35+
self.loop.call_soon_threadsafe(lambda: self.logger.log(*args, **kwargs))
3636

3737

3838
def wrap_callback(

src/confluent_kafka/serialization/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
import struct as _struct
1919
from enum import Enum
20-
from typing import Any, Optional
20+
from typing import Any, List, Optional
2121

2222
from confluent_kafka.error import KafkaException
2323
from confluent_kafka._types import HeadersType
@@ -114,7 +114,7 @@ class Serializer(object):
114114
- unicode(encoding)
115115
"""
116116

117-
__slots__ = []
117+
__slots__: List[str] = []
118118

119119
def __call__(self, obj: Any, ctx: Optional[SerializationContext] = None) -> Optional[bytes]:
120120
"""

0 commit comments

Comments
 (0)