kafka-python icon indicating copy to clipboard operation
kafka-python copied to clipboard

TopicPartition does not validate partition type as integer

Open kashifusmani opened this issue 10 years ago • 2 comments

By mistake, I ended up creating TopicPartition('topic','0') instead of TopicPartition('topic',0). Down the line, I did consumer.assign([topicPartition]) and consumer.seek(...), but never saw any warnings nor I could read messages until I debugged.

kashifusmani avatar Apr 19 '16 22:04 kashifusmani

I am not sure if it qualifies as a bug. If it does it is a problem in the core Kafka TopicPartition.java. When you passed in '0', it would have created a topic with partition 48 (ascii for '0') instead. I think a warning will be useful though.

notifytovishal avatar Apr 22 '16 01:04 notifytovishal

Closing as an ancient issue and this code has changed a bit since then. If anyone wants to spend the time to see if this can be replicated with 2.x version than I'm happy to re-open and accept a patch.

jeffwidman avatar Feb 12 '20 21:02 jeffwidman