From e1ce7e27ef335fed5c1e589df6a4e974031baac5 Mon Sep 17 00:00:00 2001 From: "Joris Z. van den Oever" Date: Wed, 30 Oct 2024 12:24:44 +0100 Subject: [PATCH] Fix incomplete documentation for AIOKafkaConsumer.offset_for_times Updates the return description to be in line with the behaviour of the offset_for_times function and the official Kafka documentation. --- aiokafka/consumer/consumer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiokafka/consumer/consumer.py b/aiokafka/consumer/consumer.py index cc509f50..559fa35a 100644 --- a/aiokafka/consumer/consumer.py +++ b/aiokafka/consumer/consumer.py @@ -927,7 +927,8 @@ async def offsets_for_times(self, timestamps): Returns: dict(TopicPartition, OffsetAndTimestamp): mapping from partition to the timestamp and offset of the first message with - timestamp greater than or equal to the target timestamp. + timestamp greater than or equal to the target timestamp. None will + be returned for the partition if there is no such message. Raises: ValueError: If the target timestamp is negative