fsspec / fsspec/filesystem_spec
Protocol of URI without authority not correctly idenfied
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 490
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 38
Description
I am currently developing a fsspec driver for a filesystem protocol that does not need/have an authority, such that:
URI = protocol ":" path
is a valid URI.
However, fsspec's split_protocol function seems to assume that an authority is always given, i.e.:
URI = protocol ":" "//" authority path
The only exceptions are data (see above) and indirectly file (see here) which are handled specifically.
Are there any issues with supporting also protocols without //authority? E.g. could we just change split_protocol to something like:
def split_protocol(urlpath):
"""Return protocol, path pair"""
urlpath = stringify_path(urlpath)
if "://" in urlpath:
protocol, path = urlpath.split("://", 1)
if len(protocol) > 1:
# excludes Windows paths
return protocol, path
elif ":/" in urlpath:
protocol, path = urlpath.split(":/", 1)
if len(protocol) > 1:
path = "/" + path
return protocol, path
if urlpath.startswith("data:"):
return urlpath.split(":", 1)
return None, urlpath
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 at fsspec/core.py around split_protocol, lines 548-558, and compare its handling with the special cases for data and file. Verify the URI forms described in the issue, including protocol:path, authority-based URLs, data URLs, and Windows paths; done means protocol-less-authority URIs are identified without breaking existing cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100