Confluent Python API for Kafka
<p>I'm getting an error with basic usage of the official Confluent Kafka Python API:</p>

<p>I subscribe:</p>

<pre><code>kafka_consumer.subscribe(topics=["my-avro-topic"], on_assign=on_assign_callback, on_revoke=on_revoke_callback)
</code></pre>

<p>Using callback:</p>

<pre><code>def on_assign_callback(consumer, topic_partitions):
for topic_partition in topic_partitions:
    print("without position. topic={}. partition={}. offset={}. error={}".format(topic_partition.topic, topic_partition.partition,
                                   topic_partition.offset, topic_partition.error))

topic_partitions_with_offsets = consumer.position(topic_partitions)
print("assigned to {}-&gt;{} partitions".format(len(topic_partitions), len(topic_partitions_with_offsets)))

for topic_partition in topic_partitions_with_offsets:
    print("with position. topic={}. partition={}. offset={}. error={}".format(topic_partition.topic, topic_partition.partition,
                                   topic_partition.offset, topic_partition.error))
</code></pre>

<p>which produces the console output:</p>

<pre><code>without position. topic=my-avro-topic. partition=0. offset=-1001. error=None
assigned to 1-&gt;1 partitions
with position. topic=my-avro-topic. partition=0. offset=-1001. error=KafkaError{code=_UNKNOWN_PARTITION,val=-190,str="(null)"}
</code></pre>

<p>Can someone explain this? Why would I get a callback notification on an unknown partition? Similar code works perfectly using the Java API.</p>