Skip to content

Commit a3ff83a

Browse files
committed
fix
1 parent 370cb8c commit a3ff83a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ydb/tests/olap/lib/ydb_cluster.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from ydb.tests.olap.lib.utils import get_external_param
99
from copy import deepcopy
1010
from time import sleep, time
11-
from typing import List, Optional
11+
from typing import List, Optional, Callable
1212
from enum import Enum
1313

1414
LOGGER = logging.getLogger()
@@ -172,15 +172,14 @@ def get_ydb_driver(cls):
172172
return cls._ydb_driver
173173

174174
@classmethod
175-
def list_directory_tree(cls, root_path: str, rel_path: str, kind_order_key = None) -> List[ydb.SchemeEntry]:
176-
"""
177-
kind_order_key: Optional[SchemeEntryType -> int]
178-
"""
175+
def list_directory_tree(cls, root_path: str, rel_path: str, kind_order_key: Optional[Callable[[ydb.SchemeEntryType], int]] = None) -> List[ydb.SchemeEntry]:
179176
path = f'{root_path}/{rel_path}' if root_path else rel_path
180177
LOGGER.info(f'list {path}')
181178
result = []
182179
entries = cls.get_ydb_driver().scheme_client.list_directory(path).children
183-
for child in sorted(entries, key=lambda x: kind_order_key(x.type)):
180+
if kind_order_key:
181+
entries = sorted(entries, key=lambda x: kind_order_key(x.type))
182+
for child in entries:
184183
if child.name == '.sys':
185184
continue
186185
child.name = f'{rel_path}/{child.name}'

ydb/tests/olap/scenario/helpers/scenario_tests_helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ def list_path_tree(self, path: str, folder: str) -> List[ydb.SchemeEntry]:
684684
ydb.SchemeEntryType.COLUMN_STORE,
685685
ydb.SchemeEntryType.EXTERNAL_DATA_SOURCE,
686686
]
687+
687688
def kind_order_key_reversed(kind):
688689
try:
689690
return -kind_order.index(kind)

0 commit comments

Comments
 (0)