11# -*- coding: utf-8 -*-
22import abc
3+ from dataclasses import dataclass
34import ydb
45from abc import abstractmethod
56import logging
@@ -327,6 +328,20 @@ def to_pb(self):
327328 return self ._pb
328329
329330
331+ @dataclass
332+ class RenameIndexItem :
333+ source_name : str
334+ destination_name : str
335+ replace_destination : bool = False
336+
337+ def to_pb (self ):
338+ return _apis .ydb_table .RenameIndexItem (
339+ source_name = self .source_name ,
340+ destination_name = self .destination_name ,
341+ replace_destination = self .replace_destination ,
342+ )
343+
344+
330345class ReplicationPolicy (object ):
331346 def __init__ (self ):
332347 self ._pb = _apis .ydb_table .ReplicationPolicy ()
@@ -1124,6 +1139,7 @@ def alter_table(
11241139 alter_partitioning_settings = None ,
11251140 set_key_bloom_filter = None ,
11261141 set_read_replicas_settings = None ,
1142+ rename_indexes = None ,
11271143 ):
11281144 pass
11291145
@@ -1321,6 +1337,7 @@ def alter_table(
13211337 alter_partitioning_settings : Optional ["ydb.PartitioningSettings" ] = None ,
13221338 set_key_bloom_filter : Optional ["ydb.FeatureFlag" ] = None ,
13231339 set_read_replicas_settings : Optional ["ydb.ReadReplicasSettings" ] = None ,
1340+ rename_indexes : Optional [List ["ydb.RenameIndexItem" ]] = None ,
13241341 ) -> "ydb.Operation" :
13251342 """
13261343 Alter a YDB table.
@@ -1340,6 +1357,7 @@ def alter_table(
13401357 :param set_compaction_policy: Compaction policy
13411358 :param alter_partitioning_settings: ydb.PartitioningSettings to alter
13421359 :param set_key_bloom_filter: ydb.FeatureFlag to set key bloom filter
1360+ :param rename_indexes: List of ydb.RenameIndexItem to rename
13431361
13441362 :return: Operation or YDB error otherwise.
13451363 """
@@ -1364,6 +1382,7 @@ def callee(session: Session):
13641382 alter_partitioning_settings = alter_partitioning_settings ,
13651383 set_key_bloom_filter = set_key_bloom_filter ,
13661384 set_read_replicas_settings = set_read_replicas_settings ,
1385+ rename_indexes = rename_indexes ,
13671386 )
13681387
13691388 return self ._pool .retry_operation_sync (callee )
@@ -1857,6 +1876,7 @@ def alter_table(
18571876 alter_partitioning_settings = None ,
18581877 set_key_bloom_filter = None ,
18591878 set_read_replicas_settings = None ,
1879+ rename_indexes = None ,
18601880 ):
18611881 return self ._driver (
18621882 _session_impl .alter_table_request_factory (
@@ -1876,6 +1896,7 @@ def alter_table(
18761896 alter_partitioning_settings ,
18771897 set_key_bloom_filter ,
18781898 set_read_replicas_settings ,
1899+ rename_indexes ,
18791900 ),
18801901 _apis .TableService .Stub ,
18811902 _apis .TableService .AlterTable ,
@@ -2088,6 +2109,7 @@ def async_alter_table(
20882109 alter_partitioning_settings = None ,
20892110 set_key_bloom_filter = None ,
20902111 set_read_replicas_settings = None ,
2112+ rename_indexes = None ,
20912113 ):
20922114 return self ._driver .future (
20932115 _session_impl .alter_table_request_factory (
@@ -2107,6 +2129,7 @@ def async_alter_table(
21072129 alter_partitioning_settings ,
21082130 set_key_bloom_filter ,
21092131 set_read_replicas_settings ,
2132+ rename_indexes ,
21102133 ),
21112134 _apis .TableService .Stub ,
21122135 _apis .TableService .AlterTable ,
0 commit comments