Feat: add tables method to fs_repository
This commit is contained in:
parent
d1c1b7420d
commit
ed8f91d78b
@ -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
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user