fsspec / fsspec/filesystem_spec
Copying between different filesystems with unrepresentable directory structure
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 490
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 38
Description
Hi @martindurant,
In universal-pathlib a user reported an incomplete copy operation when copying between s3 and local.
Turns out they are basically trying to copy the following structure to a local filesystem, which can't be represented.
s3://bucket/key # data stored in object under 'key'
s3://bucket/key/other-key-0
s3://bucket/key/other-key-1
I wonder if this issue came up when developing AbstractFileSystem.get or fsspec.generic.rsync and what an fsspec native solution for this could look like.
For UPath, I am currently working on exposing a callback, that allows the user to decide how to handle the fs.isfile('bucket/key') is True and fs.isdir('bucket/key') is True collision. I'd be happy to add an equivalent mechanism to fsspec.generic if that's a good solution.
Ideally, there would be some way that allows the filesystem class to tell if it supports a key / objectstore-like storage mechanism where directories are virtual or if a given path can't be a file and a dir at the same time.
Cheers,
Andreas
Contributor guide
No contributing guide indexed for this repository
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
Start by reading AbstractFileSystem.get and fsspec.generic.rsync, then compare how the S3-to-local collision is represented in the issue. Define and validate a filesystem-aware handling mechanism for paths that are both files and directories, with completion marked by an agreed behavior for the described copy operation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100