Skip to content

docs: sync four docstrings with their actual signatures#8264

Open
DaoyuanLi2816 wants to merge 2 commits into
huggingface:mainfrom
DaoyuanLi2816:docs/sync-docstrings-with-signatures
Open

docs: sync four docstrings with their actual signatures#8264
DaoyuanLi2816 wants to merge 2 commits into
huggingface:mainfrom
DaoyuanLi2816:docs/sync-docstrings-with-signatures

Conversation

@DaoyuanLi2816

Copy link
Copy Markdown
Contributor

What does this PR do?

Audits docstring Args sections against actual signatures and fixes three drifts:

Dataset.train_test_split

The Args section documents train_cache_file_name / test_cache_file_nameneither is a parameter; the real names are train_indices_cache_file_name / test_indices_cache_file_name. Following the docs (ds.train_test_split(train_cache_file_name=...)) raises TypeError. Renamed the two entries — their descriptions already describe the indices cache, so only the names change.

DatasetBuilder.as_dataset

Drops the verification_mode entry: the parameter no longer exists (the signature is (split, in_memory)), so the entry documents an argument that can't be passed.

table.cast_table_to_schema

The Args entry documents features ([Features]) — carried over from the sibling cast_table_to_features; this function's parameter is schema (a pa.Schema). Renamed and retyped the entry.

Docstring-only; +4 / −6 across 3 files, no behavior change.

- Dataset.train_test_split: the Args section documents
  train_cache_file_name / test_cache_file_name, which are not
  parameters — the real names are train_indices_cache_file_name /
  test_indices_cache_file_name (passing the documented names raises
  TypeError). Rename the entries; descriptions already describe the
  indices cache.
- DatasetBuilder.as_dataset: drop the verification_mode entry — the
  parameter no longer exists (signature is (split, in_memory)).
- table.cast_table_to_schema: the Args entry was carried over from
  cast_table_to_features; the parameter is schema (a pa.Schema), not
  features.
@DaoyuanLi2816 DaoyuanLi2816 changed the title docs: sync three docstrings with their actual signatures docs: sync four docstrings with their actual signatures Jun 16, 2026
@DaoyuanLi2816

Copy link
Copy Markdown
Contributor Author

Added one more: DatasetBuilder.as_dataset documented a verification_mode parameter it doesn't accept (signature is (self, split=None, in_memory=False)) — dropped the stale entry. Same drift class as the others.

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.

1 participant