-
Couldn't load subscription status.
- Fork 62
getting index type #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
getting index type #352
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can use |
||
| 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) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no needs to |
||
| else: | ||
| result.type = IndexType(IndexType.SYNCHRONOUS) | ||
| return result | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this field also should be in the constructor