diff --git a/plesna/storage/repository/fs_repository.py b/plesna/storage/repository/fs_repository.py index 063ad8b..d012594 100644 --- a/plesna/storage/repository/fs_repository.py +++ b/plesna/storage/repository/fs_repository.py @@ -120,12 +120,16 @@ class FSRepository(Repository): def _schema(self, name: str) -> FSSchema: """List schemas (sub directories within basepath)""" schema_path = self._basepath / name - tables = self.ls(name) + tables = self.tables(schema=name) return FSSchema(name=name, path=schema_path, tables=tables) def schema(self, name: str) -> Schema: return self._schema(name).ref + def tables(self, schema: str) -> list[str]: + tables = self.ls(schema) + return tables + def _table(self, schema: str, name: str) -> FSTable: """Get infos on the table""" table_path = self._basepath / schema / name diff --git a/tests/storage/test_fs_repository.py b/tests/storage/test_fs_repository.py index 522c96f..6abb64b 100644 --- a/tests/storage/test_fs_repository.py +++ b/tests/storage/test_fs_repository.py @@ -59,6 +59,7 @@ def test_list_schema(location, repository): def test_list_tables_schema(repository): assert repository.schema("schema").tables == ["username", "recovery", "salary"] + assert repository.tables(schema="schema") == ["username", "recovery", "salary"] def test_describe_table(location, repository):