Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions singlestoredb/fusion/handlers/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
for x in file_space.listdir(
params['at_path'] or '/',
recursive=params['recursive'],
return_meta=False,
return_objects=False,
):
info = file_space.info(x)
files.append(
Expand All @@ -48,7 +48,7 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
res.set_rows([(x,) for x in file_space.listdir(
params['at_path'] or '/',
recursive=params['recursive'],
return_meta=False,
return_objects=False,
)])

if params['like']:
Expand Down
4 changes: 1 addition & 3 deletions singlestoredb/management/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ def is_file(self, path: PathLike) -> bool:
pass

@overload
@abstractmethod
def listdir(
self,
path: PathLike = '/',
Expand All @@ -436,7 +435,6 @@ def listdir(
pass

@overload
@abstractmethod
def listdir(
self,
path: PathLike = '/',
Expand Down Expand Up @@ -1028,7 +1026,7 @@ def listdir(
# Validate via listing GET; if response lacks 'content', it's not a directory
try:
out = self._listdir(path, recursive=recursive, return_objects=return_objects)
except Exception as exc:
except (ManagementError, KeyError) as exc:
# If the path doesn't exist or isn't a directory, _listdir will fail
raise NotADirectoryError(f'path is not a directory: {path}') from exc

Expand Down
2 changes: 2 additions & 0 deletions singlestoredb/management/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ def listdir(
----------
stage_path : Path or str, optional
Path to the stage location
recursive : bool, optional
If True, recursively list all files and folders
return_objects : bool, optional
If True, return list of FilesObject instances. Otherwise just paths.

Expand Down