Skip to content

Commit dc43c21

Browse files
committed
Improve docstrings; remove unused kwargs
1 parent 5e60bb5 commit dc43c21

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
@@ -976,15 +976,14 @@ def refresh_done(val_or_error):
976976
def get_api_versions(self):
977977
"""Return the ApiVersions map, if available.
978978
979-
Note: A call to check_version must previously have succeeded and returned
980-
version 0.10.0 or later
979+
Note: Only available after first connection to any broker version 0.10.0 or later.
981980
982981
Returns: a map of dict mapping {api_key : (min_version, max_version)},
983982
or None if ApiVersion is not supported by the kafka cluster.
984983
"""
985984
return self._api_versions
986985

987-
def check_version(self, node_id=None, timeout=None, strict=False):
986+
def check_version(self, node_id=None, timeout=None, **kwargs):
988987
"""Attempt to guess the version of a Kafka broker.
989988
990989
Keyword Arguments:

kafka/conn.py

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

1367-
def check_version(self, timeout=2, strict=False, topics=[]):
1367+
def check_version(self, timeout=2, **kwargs):
13681368
"""Attempt to guess the broker version.
13691369
1370+
Keyword Arguments:
1371+
timeout (numeric, optional): Maximum number of seconds to block attempting
1372+
to connect and check version. Default 2
1373+
13701374
Note: This is a blocking call.
13711375
13721376
Returns: version tuple, i.e. (3, 9), (2, 4), etc ...
1377+
1378+
Raises: NodeNotReadyError on timeout
13731379
"""
13741380
timeout_at = time.time() + timeout
13751381
if not self.connect_blocking(timeout_at - time.time()):

0 commit comments

Comments
 (0)