diff options
| author | robot-piglet <[email protected]> | 2025-06-18 11:27:02 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-06-18 13:20:55 +0300 |
| commit | f2030b6e6ffca86485107e3c699f01a555bcf45b (patch) | |
| tree | ebe10351758025e03280e344288ad596d29e76be /contrib/python | |
| parent | 4a9db52b4029defc8874f7d04a8d01d98bb55f2a (diff) | |
Intermediate changes
commit_hash:a40418db4b2c00660261a326eb328f5e415a3da4
Diffstat (limited to 'contrib/python')
| -rw-r--r-- | contrib/python/ydb/py3/.dist-info/METADATA | 2 | ||||
| -rw-r--r-- | contrib/python/ydb/py3/ya.make | 2 | ||||
| -rw-r--r-- | contrib/python/ydb/py3/ydb/_grpc/grpcwrapper/ydb_topic.py | 2 | ||||
| -rw-r--r-- | contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_asyncio.py | 10 | ||||
| -rw-r--r-- | contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_sync.py | 4 | ||||
| -rw-r--r-- | contrib/python/ydb/py3/ydb/convert.py | 9 | ||||
| -rw-r--r-- | contrib/python/ydb/py3/ydb/query/base.py | 6 | ||||
| -rw-r--r-- | contrib/python/ydb/py3/ydb/topic.py | 10 | ||||
| -rw-r--r-- | contrib/python/ydb/py3/ydb/ydb_version.py | 2 |
9 files changed, 37 insertions, 10 deletions
diff --git a/contrib/python/ydb/py3/.dist-info/METADATA b/contrib/python/ydb/py3/.dist-info/METADATA index 24cd9c7d5c7..065349ff4c5 100644 --- a/contrib/python/ydb/py3/.dist-info/METADATA +++ b/contrib/python/ydb/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ydb -Version: 3.21.3 +Version: 3.21.4 Summary: YDB Python SDK Home-page: http://github.com/ydb-platform/ydb-python-sdk Author: Yandex LLC diff --git a/contrib/python/ydb/py3/ya.make b/contrib/python/ydb/py3/ya.make index 9f0be299105..ec6ff9104d0 100644 --- a/contrib/python/ydb/py3/ya.make +++ b/contrib/python/ydb/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(3.21.3) +VERSION(3.21.4) LICENSE(Apache-2.0) diff --git a/contrib/python/ydb/py3/ydb/_grpc/grpcwrapper/ydb_topic.py b/contrib/python/ydb/py3/ydb/_grpc/grpcwrapper/ydb_topic.py index 6b3594b8da4..aae3a0a1239 100644 --- a/contrib/python/ydb/py3/ydb/_grpc/grpcwrapper/ydb_topic.py +++ b/contrib/python/ydb/py3/ydb/_grpc/grpcwrapper/ydb_topic.py @@ -142,6 +142,7 @@ class CommitOffsetRequest(IToProto): consumer: str partition_id: int offset: int + read_session_id: Optional[str] def to_proto(self) -> ydb_topic_pb2.CommitOffsetRequest: return ydb_topic_pb2.CommitOffsetRequest( @@ -149,6 +150,7 @@ class CommitOffsetRequest(IToProto): consumer=self.consumer, partition_id=self.partition_id, offset=self.offset, + read_session_id=self.read_session_id, ) diff --git a/contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_asyncio.py b/contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_asyncio.py index 34c52108e17..24e8fa9ec0a 100644 --- a/contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_asyncio.py +++ b/contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_asyncio.py @@ -190,6 +190,10 @@ class PublicAsyncIOReader: self._closed = True await self._reconnector.close(flush) + @property + def read_session_id(self) -> Optional[str]: + return self._reconnector.read_session_id + class ReaderReconnector: _static_reader_reconnector_counter = AtomicCounter() @@ -373,6 +377,12 @@ class ReaderReconnector: # skip if already has result pass + @property + def read_session_id(self) -> Optional[str]: + if not self._stream_reader: + return None + return self._stream_reader._session_id + class ReaderStream: _static_id_counter = AtomicCounter() diff --git a/contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_sync.py b/contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_sync.py index bb2fc2a34b0..f7590a2195c 100644 --- a/contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_sync.py +++ b/contrib/python/ydb/py3/ydb/_topic_reader/topic_reader_sync.py @@ -204,3 +204,7 @@ class TopicReaderSync: def _check_closed(self): if self._closed: raise TopicReaderClosedError() + + @property + def read_session_id(self) -> Optional[str]: + return self._async_reader.read_session_id diff --git a/contrib/python/ydb/py3/ydb/convert.py b/contrib/python/ydb/py3/ydb/convert.py index f48e024aba7..485b58978b0 100644 --- a/contrib/python/ydb/py3/ydb/convert.py +++ b/contrib/python/ydb/py3/ydb/convert.py @@ -352,16 +352,17 @@ def _unwrap_optionality(column): class _ResultSet(object): - __slots__ = ("columns", "rows", "truncated", "snapshot") + __slots__ = ("columns", "rows", "truncated", "snapshot", "index") - def __init__(self, columns, rows, truncated, snapshot=None): + def __init__(self, columns, rows, truncated, snapshot=None, index=None): self.columns = columns self.rows = rows self.truncated = truncated self.snapshot = snapshot + self.index = index @classmethod - def from_message(cls, message, table_client_settings=None, snapshot=None): + def from_message(cls, message, table_client_settings=None, snapshot=None, index=None): rows = [] # prepare column parsers before actuall parsing column_parsers = [] @@ -384,7 +385,7 @@ class _ResultSet(object): column_parser, unwrapped_type = column_info row[column.name] = column_parser(unwrapped_type, value, table_client_settings) rows.append(row) - return cls(message.columns, rows, message.truncated, snapshot) + return cls(message.columns, rows, message.truncated, snapshot, index) @classmethod def lazy_from_message(cls, message, table_client_settings=None, snapshot=None): diff --git a/contrib/python/ydb/py3/ydb/query/base.py b/contrib/python/ydb/py3/ydb/query/base.py index 52a6312e3be..2c16716c513 100644 --- a/contrib/python/ydb/py3/ydb/query/base.py +++ b/contrib/python/ydb/py3/ydb/query/base.py @@ -208,7 +208,11 @@ def wrap_execute_query_response( session._last_query_stats = response_pb.exec_stats if response_pb.HasField("result_set"): - return convert.ResultSet.from_message(response_pb.result_set, settings) + return convert.ResultSet.from_message( + response_pb.result_set, + settings, + index=response_pb.result_set_index, + ) return None diff --git a/contrib/python/ydb/py3/ydb/topic.py b/contrib/python/ydb/py3/ydb/topic.py index ceb82efb5dc..aa6c7eb4f3b 100644 --- a/contrib/python/ydb/py3/ydb/topic.py +++ b/contrib/python/ydb/py3/ydb/topic.py @@ -340,12 +340,15 @@ class TopicClientAsyncIO: return TopicTxWriterAsyncIO(tx=tx, driver=self._driver, settings=settings, _client=self) - async def commit_offset(self, path: str, consumer: str, partition_id: int, offset: int) -> None: + async def commit_offset( + self, path: str, consumer: str, partition_id: int, offset: int, read_session_id: Optional[str] = None + ) -> None: req = _ydb_topic.CommitOffsetRequest( path=path, consumer=consumer, partition_id=partition_id, offset=offset, + read_session_id=read_session_id, ) await self._driver( @@ -618,12 +621,15 @@ class TopicClient: return TopicTxWriter(tx, self._driver, settings, _parent=self) - def commit_offset(self, path: str, consumer: str, partition_id: int, offset: int) -> None: + def commit_offset( + self, path: str, consumer: str, partition_id: int, offset: int, read_session_id: Optional[str] = None + ) -> None: req = _ydb_topic.CommitOffsetRequest( path=path, consumer=consumer, partition_id=partition_id, offset=offset, + read_session_id=read_session_id, ) self._driver( diff --git a/contrib/python/ydb/py3/ydb/ydb_version.py b/contrib/python/ydb/py3/ydb/ydb_version.py index 13f625527cb..f3776ea68db 100644 --- a/contrib/python/ydb/py3/ydb/ydb_version.py +++ b/contrib/python/ydb/py3/ydb/ydb_version.py @@ -1 +1 @@ -VERSION = "3.21.3" +VERSION = "3.21.4" |
