Skip to content

Commit ccc7d42

Browse files
Add list_topics call to custreamz Kafka reader
1 parent 3f2c913 commit ccc7d42

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

streamz/sources.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,10 @@ def checkpoint_emit(_part):
486486

487487
if self.npartitions is None:
488488
kafka_cluster_metadata = self.consumer.list_topics(self.topic)
489-
self.npartitions = len(kafka_cluster_metadata.topics[self.topic].partitions)
489+
if self.engine == "cudf": # pragma: no cover
490+
self.npartitions = len(kafka_cluster_metadata[self.topic.encode('utf-8')])
491+
else:
492+
self.npartitions = len(kafka_cluster_metadata.topics[self.topic].partitions)
490493
self.positions = [0] * self.npartitions
491494

492495
tps = []

0 commit comments

Comments
 (0)