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
11 changes: 7 additions & 4 deletions fsspec/implementations/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ def ls(self, path, detail=False, **kwargs):
path = self._strip_protocol(path)
from pyarrow.fs import FileSelector

entries = [
self._make_entry(entry)
for entry in self.fs.get_file_info(FileSelector(path))
]
try:
entries = [
self._make_entry(entry)
for entry in self.fs.get_file_info(FileSelector(path))
]
except (FileNotFoundError, NotADirectoryError):
entries = [self.info(path, **kwargs)]
if detail:
return entries
else:
Expand Down
11 changes: 11 additions & 0 deletions fsspec/implementations/tests/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ def test_ls(fs, remote_dir):
assert dirs == expected


def test_ls_one(fs, remote_dir):
if remote_dir != "/":
remote_dir = remote_dir + "/"
fs.mkdir(remote_dir + "dir/")
file = remote_dir + "dir/test_one"
fs.touch(file)

out = fs.ls(file, detail=True)
assert out[0] == fs.info(file)


def test_mkdir(fs, remote_dir):
if remote_dir != "/":
remote_dir = remote_dir + "/"
Expand Down
Loading