summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2018-03-10 10:24:31 -0500
committerGitHub <noreply@github.com>2018-03-10 10:24:31 -0500
commit22e3f75e92a791b3a42cac2a87b19ec33a4ca351 (patch)
tree97340af8be97b8c3cb90f339e108e701f706d56c
parentacbc346ddb34d2f722beaf5296dddcc12f38e2d6 (diff)
downloadkafka-python-22e3f75e92a791b3a42cac2a87b19ec33a4ca351.tar.gz
Do not validate api_version against known versions (#1434)
-rw-r--r--kafka/client_async.py17
-rw-r--r--kafka/consumer/group.py3
-rw-r--r--kafka/producer/kafka.py3
3 files changed, 3 insertions, 20 deletions
diff --git a/kafka/client_async.py b/kafka/client_async.py
index 857e4b7..ff9730e 100644
--- a/kafka/client_async.py
+++ b/kafka/client_async.py
@@ -121,8 +121,7 @@ class KafkaClient(object):
default: none.
api_version (tuple): Specify which Kafka API version to use. If set
to None, KafkaClient will attempt to infer the broker version by
- probing various APIs. For the full list of supported versions,
- see KafkaClient.API_VERSIONS. Default: None
+ probing various APIs. Example: (0, 10, 2). Default: None
api_version_auto_timeout_ms (int): number of milliseconds to throw a
timeout exception from the constructor when checking the broker
api version. Only applies if api_version is None
@@ -176,15 +175,6 @@ class KafkaClient(object):
'sasl_plain_password': None,
'sasl_kerberos_service_name': 'kafka',
}
- API_VERSIONS = [
- (0, 10, 1),
- (0, 10, 0),
- (0, 10),
- (0, 9),
- (0, 8, 2),
- (0, 8, 1),
- (0, 8, 0)
- ]
def __init__(self, **configs):
self.config = copy.copy(self.DEFAULT_CONFIG)
@@ -192,11 +182,6 @@ class KafkaClient(object):
if key in configs:
self.config[key] = configs[key]
- if self.config['api_version'] is not None:
- assert self.config['api_version'] in self.API_VERSIONS, (
- 'api_version [{0}] must be one of: {1}'.format(
- self.config['api_version'], str(self.API_VERSIONS)))
-
self.cluster = ClusterMetadata(**self.config)
self._topics = set() # empty set will fetch all topic metadata
self._metadata_refresh_in_progress = False
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py
index f6f1a67..0d9e952 100644
--- a/kafka/consumer/group.py
+++ b/kafka/consumer/group.py
@@ -208,8 +208,7 @@ class KafkaConsumer(six.Iterator):
(0, 8, 0) enables basic functionality but requires manual
partition assignment and offset management.
- For the full list of supported versions, see
- KafkaClient.API_VERSIONS. Default: None
+ Default: None
api_version_auto_timeout_ms (int): number of milliseconds to throw a
timeout exception from the constructor when checking the broker
api version. Only applies if api_version set to 'auto'
diff --git a/kafka/producer/kafka.py b/kafka/producer/kafka.py
index 4a93de6..52c0953 100644
--- a/kafka/producer/kafka.py
+++ b/kafka/producer/kafka.py
@@ -242,8 +242,7 @@ class KafkaProducer(object):
default: none.
api_version (tuple): Specify which Kafka API version to use. If set to
None, the client will attempt to infer the broker version by probing
- various APIs. For a full list of supported versions, see
- KafkaClient.API_VERSIONS. Default: None
+ various APIs. Example: (0, 10, 2). Default: None
api_version_auto_timeout_ms (int): number of milliseconds to throw a
timeout exception from the constructor when checking the broker
api version. Only applies if api_version set to 'auto'