diff --git a/ydb/table.py b/ydb/table.py index c21392bb..5686d27a 100644 --- a/ydb/table.py +++ b/ydb/table.py @@ -286,6 +286,7 @@ def __init__(self, name): self.index_columns = [] # output only. self.status = None + self.type = None def with_global_index(self): self._pb.global_index.SetInParent() @@ -301,6 +302,12 @@ def to_pb(self): return self._pb +@enum.unique +class IndexType(enum.IntEnum): + SYNCHRONOUS = 0 + ASYNCHRONOUS = 1 + + class ReplicationPolicy(object): def __init__(self): self._pb = _apis.ydb_table.ReplicationPolicy() @@ -1337,6 +1344,10 @@ def async_bulk_upsert(self, table_path, rows, column_types, settings=None): def _make_index_description(index): result = TableIndex(index.name).with_index_columns(*tuple(col for col in index.index_columns)) result.status = IndexStatus(index.status) + if index.HasField("global_async_index"): + result.type = IndexType(IndexType.ASYNCHRONOUS) + else: + result.type = IndexType(IndexType.SYNCHRONOUS) return result