Repository navigation
[Docs] Document missing parameters in lfs, hf_file_system, and repocard_data - #4289
Merged
Wauplin merged 2 commits intoMay 28, 2026
Merged
Conversation
…rd_data Four parameters in public functions were missing from their Args sections: - post_lfs_batch_info(): missing `token` (required parameter) and `endpoint` - lfs_upload(): missing `token` and `endpoint` - HfFileSystem.glob(): missing `maxdepth` (the equivalent fsspec parameter is already documented in HfFileSystem.find()) - CardData.to_yaml(): missing `original_order`
|
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.17.0 release. |
Wauplin
pushed a commit
that referenced
this pull request
Jun 1, 2026
- file_download.py: add `endpoint` to hf_hub_download Args - _snapshot_download.py: add `endpoint` to snapshot_download Args - repocard.py: add `template_str` to RepoCard / ModelCard / DatasetCard from_template Args (×3) All five parameters are already in the signatures; this only fills the docstrings. Same shape as #4289.
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.
Summary
Four parameters in public functions were missing from their docstring
Args:sections.post_lfs_batch_info()inlfs.py—token(a required parameter) andendpointwere both missing.tokenis the auth token and is required for the call to work; users had to read the source to discover it.lfs_upload()inlfs.py—tokenandendpointmissing.HfFileSystem.glob()inhf_file_system.py—maxdepthmissing. The sibling methodHfFileSystem.find()already documents the same fsspec parameter; I reused that wording for consistency.CardData.to_yaml()inrepocard_data.py—original_ordermissing. This is the parameter that lets callers preserve the original key order when round-tripping a YAML block.No code logic was changed — pure docstring additions.
Files changed
src/huggingface_hub/lfs.pysrc/huggingface_hub/hf_file_system.pysrc/huggingface_hub/repocard_data.pyNote
Low Risk
Only docstring text was added; no executable code paths changed.
Overview
Docstring-only PR — fills in missing
Args:entries for public APIs in three modules; no runtime or behavior changes.In
lfs.py,post_lfs_batch_infonow documentstoken(auth;Noneuses cached token) andendpoint(Hub base URL).lfs_uploaddocuments the sametokenandendpointparameters.In
hf_file_system.py,HfFileSystem.globdocumentsmaxdepth, aligned with the existingfinddocstring and fsspec semantics.In
repocard_data.py,CardData.to_yamldocumentsoriginal_orderfor preserving YAML key order when round-tripping README metadata.Reviewed by Cursor Bugbot for commit bad0e35. Bugbot is set up for automated code reviews on this repo. Configure here.