Skip to content

Commit 64b1671

Browse files
author
Rasmus Nygren
committed
Fix AdminClient type annotation (#2244)
1 parent 7d0abd5 commit 64b1671

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/confluent_kafka/admin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import concurrent.futures
2525
import warnings
26-
from typing import Any, Dict, List, Optional, Set, Tuple, Union
26+
from typing import Any, Dict, List, Mapping, Optional, Set, Tuple, Union
2727

2828
from confluent_kafka import ConsumerGroupState as _ConsumerGroupState
2929
from confluent_kafka import ConsumerGroupTopicPartitions as _ConsumerGroupTopicPartitions
@@ -115,7 +115,7 @@ class AdminClient(_AdminClientImpl):
115115
Requires broker version v0.11.0.0 or later.
116116
"""
117117

118-
def __init__(self, conf: Dict[str, Union[str, int, float, bool]], **kwargs: Any) -> None:
118+
def __init__(self, conf: Mapping[str, Union[str, int, float, bool]], **kwargs: Any) -> None:
119119
"""
120120
Create a new AdminClient using the provided configuration dictionary.
121121

src/confluent_kafka/cimpl.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ maintenance burden and get type hints directly from the implementation.
3535
"""
3636

3737
import builtins
38-
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union, overload
38+
from typing import Any, Callable, Dict, List, Literal, Mapping, Optional, Tuple, Union, overload
3939

4040
try:
4141
from typing import Self
@@ -540,7 +540,7 @@ class Consumer:
540540
def set_sasl_credentials(self, username: str, password: str) -> None: ...
541541

542542
class _AdminClientImpl:
543-
def __init__(self, config: Dict[str, Union[str, int, float, bool]]) -> None: ...
543+
def __init__(self, config: Mapping[str, Union[str, int, float, bool]]) -> None: ...
544544
def __enter__(self) -> Self: ...
545545
def __exit__(self, exc_type: Any, exc_value: Any, exc_traceback: Any) -> Optional[bool]: ...
546546
def create_topics(

0 commit comments

Comments
 (0)