Skip to content

Commit 91d0bc2

Browse files
committed
Improve docstrings; remove unused kwargs
1 parent 4acd084 commit 91d0bc2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

kafka/client_async.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -939,15 +939,14 @@ def refresh_done(val_or_error):
939939
def get_api_versions(self):
940940
"""Return the ApiVersions map, if available.
941941
942-
Note: A call to check_version must previously have succeeded and returned
943-
version 0.10.0 or later
942+
Note: Only available after first connection to any broker version 0.10.0 or later.
944943
945944
Returns: a map of dict mapping {api_key : (min_version, max_version)},
946945
or None if ApiVersion is not supported by the kafka cluster.
947946
"""
948947
return self._api_versions
949948

950-
def check_version(self, node_id=None, timeout=None, strict=False):
949+
def check_version(self, node_id=None, timeout=None, **kwargs):
951950
"""Attempt to guess the version of a Kafka broker.
952951
953952
Keyword Arguments:

kafka/conn.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,12 +1320,18 @@ def _infer_broker_version_from_api_versions(self, api_versions):
13201320
# so if all else fails, choose that
13211321
return (0, 10, 0)
13221322

1323-
def check_version(self, timeout=2, strict=False, topics=[]):
1323+
def check_version(self, timeout=2, **kwargs):
13241324
"""Attempt to guess the broker version.
13251325
1326+
Keyword Arguments:
1327+
timeout (numeric, optional): Maximum number of seconds to block attempting
1328+
to connect and check version. Default 2
1329+
13261330
Note: This is a blocking call.
13271331
13281332
Returns: version tuple, i.e. (3, 9), (2, 4), etc ...
1333+
1334+
Raises: NodeNotReadyError on timeout
13291335
"""
13301336
timeout_at = time.time() + timeout
13311337
if not self.connect_blocking(timeout_at - time.time()):

0 commit comments

Comments
 (0)