Skip to content

Commit 46fd78c

Browse files
committed
Added functions for check column table type table of any type of scheme entry
1 parent 6c745e1 commit 46fd78c

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Added functions for check column table type table of any type of scheme entry
2+
13
## 3.4.0 ##
24
* Add to public topic reader api: TopicReaderBatch, wait_message
35

ydb/scheme.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,31 @@ def _missing_(cls, value):
3232
def is_table(entry):
3333
"""
3434
:param entry: A scheme entry to check
35-
:return: True if scheme entry is a table and False otherwise
35+
:return: True if scheme entry is a row table and False otherwise (same as is_row_table)
36+
"""
37+
return entry == SchemeEntryType.TABLE
38+
39+
@staticmethod
40+
def is_any_table(entry):
41+
"""
42+
:param entry: A scheme entry to check
43+
:return: True if scheme entry is table of any type and False otherwise
44+
"""
45+
return entry in [SchemeEntryType.TABLE, SchemeEntryType.COLUMN_TABLE]
46+
47+
@staticmethod
48+
def is_column_table(entry):
49+
"""
50+
:param entry: A scheme entry to check
51+
:return: True if scheme entry is a column table and False otherwise
52+
"""
53+
return entry == SchemeEntryType.COLUMN_TABLE
54+
55+
@staticmethod
56+
def is_row_table(entry):
57+
"""
58+
:param entry: A scheme entry to check
59+
:return: True if scheme entry is a row table and False otherwise (same as is_table)
3660
"""
3761
return entry == SchemeEntryType.TABLE
3862

0 commit comments

Comments
 (0)