Skip to content

Commit 3dba5c7

Browse files
committed
* add types to public API
* check consumer arg type
1 parent 29048b8 commit 3dba5c7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ydb/_topic_reader/topic_reader.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class PublicReaderSettings:
3838
decoder_executor: Optional[concurrent.futures.Executor] = None
3939
update_token_interval: Union[int, float] = 3600
4040

41+
def __post_init__(self):
42+
if not isinstance(self.consumer, str):
43+
raise TypeError("Unsupported type for consumer: '%s'" % type(self.consumer))
44+
4145
def _init_message(self) -> StreamReadMessage.InitRequest:
4246
return StreamReadMessage.InitRequest(
4347
topics_read_settings=[

ydb/topic.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
"TopicReaderAsyncIO",
1414
"TopicReaderSettings",
1515
"TopicStatWindow",
16+
"TopicWriteResult",
1617
"TopicWriter",
1718
"TopicWriterAsyncIO",
19+
"TopicWriterInitInfo",
1820
"TopicWriterMessage",
1921
"TopicWriterSettings",
2022
]
@@ -42,6 +44,8 @@
4244
PublicWriterSettings as TopicWriterSettings,
4345
PublicMessage as TopicWriterMessage,
4446
RetryPolicy as TopicWriterRetryPolicy,
47+
PublicWriterInitInfo as TopicWriterInitInfo,
48+
PublicWriteResult as TopicWriteResult,
4549
)
4650

4751
from ydb._topic_writer.topic_writer_asyncio import WriterAsyncIO as TopicWriterAsyncIO

0 commit comments

Comments
 (0)