Skip to content

Commit c7c583d

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

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sdks/python/apache_beam/io/kafka.py

Lines changed: 8 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,9 @@ 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[str] = None,
177+
consumer_factory_fn_params: typing.Optional[
178+
collections.abc.Mapping] = None):
175179
"""
176180
Initializes a read operation from Kafka.
177181
@@ -218,7 +222,7 @@ def __init__(
218222
existing provided consumerFactoryFn. If not None, this will construct
219223
Kafka consumers with a custom configuration.
220224
: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
225+
the provided consumer_factory_fn_class. If not None, the values in this
222226
map will be used when constructing the consumer_factory_fn_class object.
223227
This cannot be null if the consumer_factory_fn_class is not null.
224228
"""

0 commit comments

Comments
 (0)