Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove offsets version limit #1199

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions kafka/consumer/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,10 +893,6 @@ def offsets_for_times(self, timestamps):
up the offsets by timestamp.
KafkaTimeoutError: If fetch failed in request_timeout_ms
"""
if self.config['api_version'] <= (0, 10, 0):
raise UnsupportedVersionError(
"offsets_for_times API not supported for cluster version {}"
.format(self.config['api_version']))
for tp, ts in timestamps.items():
timestamps[tp] = int(ts)
if ts < 0:
Expand Down Expand Up @@ -928,10 +924,6 @@ def beginning_offsets(self, partitions):
up the offsets by timestamp.
KafkaTimeoutError: If fetch failed in request_timeout_ms.
"""
if self.config['api_version'] <= (0, 10, 0):
raise UnsupportedVersionError(
"offsets_for_times API not supported for cluster version {}"
.format(self.config['api_version']))
offsets = self._fetcher.beginning_offsets(
partitions, self.config['request_timeout_ms'])
return offsets
Expand Down Expand Up @@ -959,10 +951,6 @@ def end_offsets(self, partitions):
up the offsets by timestamp.
KafkaTimeoutError: If fetch failed in request_timeout_ms
"""
if self.config['api_version'] <= (0, 10, 0):
raise UnsupportedVersionError(
"offsets_for_times API not supported for cluster version {}"
.format(self.config['api_version']))
offsets = self._fetcher.end_offsets(
partitions, self.config['request_timeout_ms'])
return offsets
Expand Down
14 changes: 0 additions & 14 deletions test/test_consumer_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,20 +727,6 @@ def test_kafka_consumer_offsets_search_many_partitions(self):
tp1: p1msg.offset + 1
})

@kafka_versions('<0.10.1')
def test_kafka_consumer_offsets_for_time_old(self):
consumer = self.kafka_consumer()
tp = TopicPartition(self.topic, 0)

with self.assertRaises(UnsupportedVersionError):
consumer.offsets_for_times({tp: int(time.time())})

with self.assertRaises(UnsupportedVersionError):
consumer.beginning_offsets([tp])

with self.assertRaises(UnsupportedVersionError):
consumer.end_offsets([tp])

@kafka_versions('>=0.10.1')
def test_kafka_consumer_offsets_for_times_errors(self):
consumer = self.kafka_consumer()
Expand Down