Skip to content

Commit

Permalink
Implemented the return type of the send function;
Browse files Browse the repository at this point in the history
It would be nice to have an accessible and easy way to know the returns of the send functions, as the Documentation doesn't have a index for RecordMetadata;
  • Loading branch information
JGabrielGruber authored May 13, 2021
1 parent f19e423 commit 1882872
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kafka/producer/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from kafka.codec import has_gzip, has_snappy, has_lz4, has_zstd
from kafka.metrics import MetricConfig, Metrics
from kafka.partitioner.default import DefaultPartitioner
from kafka.producer.future import FutureRecordMetadata, FutureProduceResult
from kafka.producer.future import FutureRecordMetadata, FutureProduceResult, RecordMetadata
from kafka.producer.record_accumulator import AtomicInteger, RecordAccumulator
from kafka.producer.sender import Sender
from kafka.record.default_records import DefaultRecordBatchBuilder
Expand Down Expand Up @@ -538,7 +538,7 @@ def _estimate_size_in_bytes(self, key, value, headers=[]):
return LegacyRecordBatchBuilder.estimate_size_in_bytes(
magic, self.config['compression_type'], key, value)

def send(self, topic, value=None, key=None, headers=None, partition=None, timestamp_ms=None):
def send(self, topic, value=None, key=None, headers=None, partition=None, timestamp_ms=None) -> RecordMetadata:
"""Publish a message to a topic.
Arguments:
Expand Down

0 comments on commit 1882872

Please sign in to comment.