You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
partitions_for_topic method return type is set. However, if the topic does not exists, ClusterMetadata's method returns None (and thus KafkaConsumer's, which calls ClusterMetadata's partitions_for_topic for that topic).
Notice that the solution should either update the documentation (explictly stating that the method may return None, its type is Optional[set]) or even better, just returning an empty set if the topic is not found.
The text was updated successfully, but these errors were encountered:
According to documentation:
https://kafka-python.readthedocs.io/en/master/apidoc/KafkaConsumer.html
https://kafka-python.readthedocs.io/en/master/apidoc/ClusterMetadata.html
partitions_for_topic
method return type isset
. However, if the topic does not exists,ClusterMetadata
's method returnsNone
(and thusKafkaConsumer
's, which callsClusterMetadata
'spartitions_for_topic
for that topic).Notice that the solution should either update the documentation (explictly stating that the method may return
None
, its type isOptional[set]
) or even better, just returning an emptyset
if the topic is not found.The text was updated successfully, but these errors were encountered: