Skip to content

Commit 70ca966

Browse files
authored
Fix list dir signature (#11550)
1 parent d4c693f commit 70ca966

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ydb/tests/olap/lib/ydb_cluster.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,17 @@ def get_ydb_driver(cls):
129129
return cls._ydb_driver
130130

131131
@classmethod
132-
def _list_directory_impl(cls, path) -> List[ydb.SchemeEntry]:
132+
def list_directory(cls, root_path: str, rel_path: str) -> List[ydb.SchemeEntry]:
133+
path = f'{root_path}/{rel_path}' if root_path else rel_path
133134
LOGGER.info(f'list {path}')
134135
result = []
135136
for child in cls.get_ydb_driver().scheme_client.list_directory(path).children:
136137
if child.name == '.sys':
137138
continue
138-
child.name = f'{path}/{child.name}'
139+
child.name = f'{rel_path}/{child.name}'
139140
result.append(child)
140141
if child.is_directory() or child.is_column_store():
141-
result += cls._list_directory_impl(child.name)
142+
result += cls.list_directory(root_path, child.name)
142143
return result
143144

144145
@classmethod
@@ -154,7 +155,7 @@ def _get_tables(cls, path):
154155
self_descr = cls._describe_path_impl(full_path)
155156
if self_descr is not None:
156157
if self_descr.is_directory():
157-
for descr in cls._list_directory_impl(full_path):
158+
for descr in cls.list_directory('', full_path):
158159
if descr.is_any_table():
159160
result.append(descr.name)
160161
elif self_descr.is_any_table():

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ def list_path(self, path: str) -> List[ydb.SchemeEntry]:
586586
if self_descr is not None:
587587
self_descr.name = path
588588
if self_descr.is_directory():
589-
result = YdbCluster._list_directory_impl(root_path, path)
589+
result = YdbCluster.list_directory(root_path, path)
590590
result.append(self_descr)
591591
allure.attach('\n'.join([f'{e.name}: {repr(e.type)}' for e in result]), 'result', allure.attachment_type.TEXT)
592592
return result

0 commit comments

Comments
 (0)