datasets icon indicating copy to clipboard operation
datasets copied to clipboard

docs: sync four docstrings with their actual signatures

Open DaoyuanLi2816 opened this issue 5 months ago • 1 comments

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_name — neither 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.

DaoyuanLi2816 avatar Jun 12 '26 18:06 DaoyuanLi2816

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.

DaoyuanLi2816 avatar Jun 16 '26 19:06 DaoyuanLi2816