Skip to content

Commit e43a738

Browse files
authored
Fix typing bugs found by beartype (#993)
1 parent 256ce17 commit e43a738

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

aiokafka/admin/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
from collections import defaultdict
44
from ssl import SSLContext
5-
from typing import Any, Dict, List, Optional, Tuple, Union
5+
from typing import Any, Dict, List, Optional, Sequence, Tuple, Type, Union
66

77
from aiokafka import __version__
88
from aiokafka.client import AIOKafkaClient
@@ -156,7 +156,7 @@ async def start(self):
156156
log.debug("AIOKafkaAdminClient started")
157157
self._started = True
158158

159-
def _matching_api_version(self, operation: List[Request]) -> int:
159+
def _matching_api_version(self, operation: Sequence[Type[Request]]) -> int:
160160
"""Find the latest version of the protocol operation
161161
supported by both this library and the broker.
162162
@@ -332,7 +332,9 @@ async def describe_configs(
332332
futures.append(self._send_request(req))
333333
return await asyncio.gather(*futures)
334334

335-
async def alter_configs(self, config_resources: List[ConfigResource]) -> Response:
335+
async def alter_configs(
336+
self, config_resources: List[ConfigResource]
337+
) -> List[Response]:
336338
"""Alter configuration parameters of one or more Kafka resources.
337339
:param config_resources: A list of ConfigResource objects.
338340
:return: Appropriate version of AlterConfigsResponse class.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ select = [
123123
"PL", # Pylint
124124
"TRY", # tryceratops
125125
"PERF", # Perflint
126-
"LOG", # flake8-logging
126+
# "LOG", # flake8-logging
127127
"RUF", # Ruff-specific
128128
]
129129

@@ -168,3 +168,4 @@ strict_equality = true
168168
warn_redundant_casts = true
169169
warn_unused_ignores = true
170170
follow_imports = "silent" # FIXME Remove after adding annotations
171+
local_partial_types = true # TODO Remove when it becomes default

requirements-ci.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-r requirements-cython.txt
2-
ruff==0.3.2
3-
mypy==1.8.0
2+
ruff==0.3.4
3+
mypy==1.9.0
44
pytest==7.4.3
55
pytest-cov==4.1.0
66
pytest-asyncio==0.21.1

requirements-win-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-r requirements-cython.txt
22
ruff==0.3.2
3-
mypy==1.8.0
3+
mypy==1.9.0
44
pytest==7.4.3
55
pytest-cov==4.1.0
66
pytest-asyncio==0.21.1

0 commit comments

Comments
 (0)