Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve uri scheme parsing with list of available schemes from fsspec #1009

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

lobis
Copy link
Collaborator

@lobis lobis commented Oct 25, 2023

Use fsspec to get the list of supported uri schemes. Direct the user to this list in case of an invalid scheme.

Changes: paths such as file.root://object-with-too-many-slashes will now throw a ValueError saying that the file.root:// scheme is not in the list of valid schemes.

@lobis lobis marked this pull request as ready for review October 25, 2023 19:26
@lobis lobis requested a review from jpivarski October 25, 2023 19:26
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose there's no legitimate reason to use :// in a file path or an object path (both of which use /+ as a delimiter, and the initial / in an object path is optional). Therefore, if someone gets the "Invalid URI scheme" error message, they'll likely recognize what it is and they'll have a recourse to work around it.

Is it possible to get the _remote_schemes from fsspec? Just wondering.

Anyway, this PR is good and may be merged.

@lobis
Copy link
Collaborator Author

lobis commented Oct 25, 2023

I suppose there's no legitimate reason to use :// in a file path or an object path (both of which use /+ as a delimiter, and the initial / in an object path is optional). Therefore, if someone gets the "Invalid URI scheme" error message, they'll likely recognize what it is and they'll have a recourse to work around it.

Is it possible to get the _remote_schemes from fsspec? Just wondering.

Anyway, this PR is good and may be merged.

Yes, we can get all schemes from fsspec. I left the previous code there because fsspec is not yet a dependency. Once it is this will be further simplified.

@lobis lobis merged commit b4209bf into main Oct 25, 2023
19 checks passed
@lobis lobis deleted the uri-schemas branch October 25, 2023 20:38
@jpivarski
Copy link
Member

I left the previous code there because fsspec is not yet a dependency.

Of course! That makes a lot of sense.

@lobis lobis mentioned this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants