Skip to content

[Docs] Document missing parameters in lfs, hf_file_system, and repocard_data - #4289

Merged
Wauplin merged 2 commits into
huggingface:mainfrom
kratos0718:fix/document-missing-params
May 28, 2026
Merged

Wauplin merged 2 commits into
huggingface:mainfrom
kratos0718:fix/document-missing-params

Conversation

@kratos0718

@kratos0718 kratos0718 commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Four parameters in public functions were missing from their docstring Args: sections.

  • post_lfs_batch_info() in lfs.py — token (a required parameter) and endpoint were both missing. token is the auth token and is required for the call to work; users had to read the source to discover it.
  • lfs_upload() in lfs.py — token and endpoint missing.
  • HfFileSystem.glob() in hf_file_system.py — maxdepth missing. The sibling method HfFileSystem.find() already documents the same fsspec parameter; I reused that wording for consistency.
  • CardData.to_yaml() in repocard_data.py — original_order missing. 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.py
  • src/huggingface_hub/hf_file_system.py
  • src/huggingface_hub/repocard_data.py

Note

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_info now documents token (auth; None uses cached token) and endpoint (Hub base URL). lfs_upload documents the same token and endpoint parameters.

In hf_file_system.py, HfFileSystem.glob documents maxdepth, aligned with the existing find docstring and fsspec semantics.

In repocard_data.py, CardData.to_yaml documents original_order for 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.

kratos0718 and others added 2 commits May 28, 2026 11:48
…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`
@bot-ci-comment

Copy link
Copy Markdown

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.

@Wauplin Wauplin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you!

@Wauplin
Wauplin merged commit 714044e into huggingface:main May 28, 2026
17 of 21 checks passed
@huggingface-hub-bot

Copy link
Copy Markdown
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.
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.

3 participants