Skip to content

Commit

Permalink
Added functions for check column table type table of any type of sche…
Browse files Browse the repository at this point in the history
…me entry
  • Loading branch information
rekby committed Aug 23, 2023
1 parent 6c745e1 commit 46fd78c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Added functions for check column table type table of any type of scheme entry

## 3.4.0 ##
* Add to public topic reader api: TopicReaderBatch, wait_message

Expand Down
26 changes: 25 additions & 1 deletion ydb/scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,31 @@ def _missing_(cls, value):
def is_table(entry):
"""
:param entry: A scheme entry to check
:return: True if scheme entry is a table and False otherwise
:return: True if scheme entry is a row table and False otherwise (same as is_row_table)
"""
return entry == SchemeEntryType.TABLE

@staticmethod
def is_any_table(entry):
"""
:param entry: A scheme entry to check
:return: True if scheme entry is table of any type and False otherwise
"""
return entry in [SchemeEntryType.TABLE, SchemeEntryType.COLUMN_TABLE]

@staticmethod
def is_column_table(entry):
"""
:param entry: A scheme entry to check
:return: True if scheme entry is a column table and False otherwise
"""
return entry == SchemeEntryType.COLUMN_TABLE

@staticmethod
def is_row_table(entry):
"""
:param entry: A scheme entry to check
:return: True if scheme entry is a row table and False otherwise (same as is_table)
"""
return entry == SchemeEntryType.TABLE

Expand Down

0 comments on commit 46fd78c

Please sign in to comment.