Skip to content

Commit

Permalink
Update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Tincu committed Mar 19, 2020
1 parent 016b8c9 commit aaf61ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kafka/producer/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def _handle_produce_response(self, node_id, send_time, batches, response):
for topic, partitions in response.topics:
for partition_info in partitions:
global_error = None
log_start_offset = None
if response.API_VERSION < 2:
partition, error_code, offset = partition_info
ts = None
Expand All @@ -208,7 +209,7 @@ def _handle_produce_response(self, node_id, send_time, batches, response):
tp = TopicPartition(topic, partition)
error = Errors.for_code(error_code)
batch = batches_by_partition[tp]
self._complete_batch(batch, error, offset, ts, global_error)
self._complete_batch(batch, error, offset, ts, log_start_offset, global_error)

if response.API_VERSION > 0:
self._sensors.record_throttle_time(response.throttle_time_ms, node=node_id)
Expand All @@ -227,6 +228,7 @@ def _complete_batch(self, batch, error, base_offset, timestamp_ms=None, log_star
base_offset (int): The base offset assigned to the records if successful
timestamp_ms (int, optional): The timestamp returned by the broker for this batch
log_start_offset (int): The start offset of the log at the time this produce response was created
global_error (Exception): The summarising error message
"""
# Standardize no-error to None
if error is Errors.NoError:
Expand Down

0 comments on commit aaf61ff

Please sign in to comment.