summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@rd.io>2016-01-02 13:21:16 -0800
committerDana Powers <dana.powers@rd.io>2016-01-02 13:21:26 -0800
commit00a1e6e81935b3a32d339eeb3f9be316d42642c4 (patch)
treebced34b28c95a19b375b508ce2f74c2653a3642b
parent24a4c2a7c5a1265899316aca86a1149496d6564e (diff)
downloadkafka-python-00a1e6e81935b3a32d339eeb3f9be316d42642c4.tar.gz
Batched message methods now return dict of lists
-rw-r--r--kafka/consumer/fetcher.py4
-rw-r--r--kafka/consumer/group.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/kafka/consumer/fetcher.py b/kafka/consumer/fetcher.py
index ddf9d6f..8f25561 100644
--- a/kafka/consumer/fetcher.py
+++ b/kafka/consumer/fetcher.py
@@ -267,14 +267,14 @@ class Fetcher(six.Iterator):
AssertionError: if used with iterator (incompatible)
Returns:
- dict: {TopicPartition: deque([messages])}
+ dict: {TopicPartition: [messages]}
"""
assert self._iterator is None, (
'fetched_records is incompatible with message iterator')
if self._subscriptions.needs_partition_assignment:
return {}
- drained = collections.defaultdict(collections.deque)
+ drained = collections.defaultdict(list)
self._raise_if_offset_out_of_range()
self._raise_if_unauthorized_topics()
self._raise_if_record_too_large()
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py
index cea2e1c..33563b8 100644
--- a/kafka/consumer/group.py
+++ b/kafka/consumer/group.py
@@ -343,7 +343,7 @@ class KafkaConsumer(six.Iterator):
records that are available now. Must not be negative. Default: 0
Returns:
- dict: topic to deque of records since the last fetch for the
+ dict: topic to list of records since the last fetch for the
subscribed list of topics and partitions
"""
assert timeout_ms >= 0, 'Timeout must not be negative'
@@ -377,7 +377,7 @@ class KafkaConsumer(six.Iterator):
timeout_ms (int): The maximum time in milliseconds to block
Returns:
- dict: map of topic to deque of records (may be empty)
+ dict: map of topic to list of records (may be empty)
"""
# TODO: Sub-requests should take into account the poll timeout (KAFKA-1894)
self._coordinator.ensure_coordinator_known()