Skip to content

Commit 8c389bc

Browse files
committed
Clean up typing.
1 parent 78b8a07 commit 8c389bc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

sdks/python/apache_beam/io/kafka.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100

101101
# pytype: skip-file
102102

103+
import collections
103104
import typing
104105

105106
import numpy as np
@@ -122,7 +123,9 @@
122123
('allow_duplicates', typing.Optional[bool]),
123124
('dynamic_read_poll_interval_seconds', typing.Optional[int]),
124125
('consumer_factory_fn_class', typing.Optional[str]),
125-
('consumer_factory_fn_params', typing.Optional[typing.Mapping[str, str]])])
126+
(
127+
'consumer_factory_fn_params',
128+
typing.Optional[collections.abc.Mapping[str, str]])])
126129

127130

128131
def default_io_expansion_service(append_args=None):
@@ -170,8 +173,10 @@ def __init__(
170173
redistribute_num_keys=np.int32(0),
171174
allow_duplicates=False,
172175
dynamic_read_poll_interval_seconds: typing.Optional[int] = None,
173-
consumer_factory_fn_class=None,
174-
consumer_factory_fn_params=None):
176+
consumer_factory_fn_class: typing.Optional[
177+
collections.abc.Mapping] = None,
178+
consumer_factory_fn_params: typing.Optional[
179+
collections.abc.Mapping] = None):
175180
"""
176181
Initializes a read operation from Kafka.
177182
@@ -218,7 +223,7 @@ def __init__(
218223
existing provided consumerFactoryFn. If not None, this will construct
219224
Kafka consumers with a custom configuration.
220225
:param consumer_factory_fn_params: A map which specifies the parameters for
221-
the provided consumer_factory_fn_class. IF not None, the values in this
226+
the provided consumer_factory_fn_class. If not None, the values in this
222227
map will be used when constructing the consumer_factory_fn_class object.
223228
This cannot be null if the consumer_factory_fn_class is not null.
224229
"""

0 commit comments

Comments
 (0)