diff options
author | Taras Voinarovskiy <voyn1991@gmail.com> | 2017-07-31 12:41:53 +0000 |
---|---|---|
committer | Taras Voinarovskiy <voyn1991@gmail.com> | 2017-08-07 09:34:08 +0000 |
commit | 63992f907aaabc4055d02de60f789443fcb4b54f (patch) | |
tree | 78208f5abef771e624ba9099f0dc274bc171f357 /kafka/consumer/group.py | |
parent | f244e527a9674fa22b0bf9771585598cb758c8b1 (diff) | |
download | kafka-python-63992f907aaabc4055d02de60f789443fcb4b54f.tar.gz |
Changed retrieve_offsets to allow fetching multiple offsets at once
Diffstat (limited to 'kafka/consumer/group.py')
-rw-r--r-- | kafka/consumer/group.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index f9b8f16..48a88b2 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -881,7 +881,8 @@ class KafkaConsumer(six.Iterator): Arguments: timestamps (dict): ``{TopicPartition: int}`` mapping from partition - to the timestamp to look up. + to the timestamp to look up. Unit should be milliseconds since + beginning of the epoch (midnight Jan 1, 1970 (UTC)) Raises: ValueError: if the target timestamp is negative @@ -894,6 +895,7 @@ class KafkaConsumer(six.Iterator): "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: raise ValueError( "The target time for partition {} is {}. The target time " |