[CLI] Accept web URLs in bucket CLI commands#4315
Merged
Merged
Conversation
Make _parse_bucket_uri accept Hugging Face web URLs (e.g. https://huggingface.co/buckets/namespace/name) in addition to hf:// URIs and plain namespace/name paths, leveraging URL parsing from #4296. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Contributor
|
This PR has been shipped as part of the v1.19.0 release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #4296.
Forgot to update
_parse_bucket_urito also accept URLs copy-pasted from the browser in addition tohf://URIs and plainnamespace/namepaths.Example:
(previously:
Error: Invalid bucket path ... Expected format: namespace/bucket_name)Note
Low Risk
Small, localized parser change reusing existing
parse_hf_uriURL handling; behavior for non-URL paths is unchanged.Overview
Bucket path parsing now treats copy-pasted
https://huggingface.co/buckets/...links like existinghf://buckets/...URIs by routing them throughparse_hf_uriwhen_looks_like_hf_urlmatches, instead of failing as plainnamespace/namepaths.Docstrings for
_parse_bucket_uridocument the new accepted form. A CLI test assertshf buckets listwith a web URL produces the same recursive listing as thehf://form.Reviewed by Cursor Bugbot for commit 4d2ea8b. Bugbot is set up for automated code reviews on this repo. Configure here.