ls returns full path, not just items
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 305
- Avg merge
- 22h 37m
- Merged PRs (30d)
- 4
Description
s3fs.S3FileSystem().ls(bucket_path) currently returns: [f'{bucket_path}/file1.txt', f'{bucket_path}/file2.txt', ...].
But running ls, in linux or python's similar function, os.listdir(path), returns just the file names, e.g. ['file1.txt', 'file2.txt', ...].
This is closer to what I'd expect from the docstring as well: https://github.com/fsspec/s3fs/blob/main/s3fs/core.py#L261-L265
>>> s3fs.__version__
'2024.9.0'
I just find this behavior confusing. I'm assuming this would be a relatively large breaking change for most users, but maybe we could add a flag to just return the file names?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read s3fs/core.py around lines 261-265 and inspect the existing tests for S3FileSystem.ls. First resolve whether the current full-path behavior must remain the default or whether an opt-in flag is appropriate; done means the selected behavior is documented and covered by regression tests without unintentionally breaking existing callers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100