Skip to content

docs: fix docstring Args entries that name a parameter the function does not take - #5685

Open
darkdi wants to merge 1 commit into
bentoml:mainfrom
darkdi:fix/docstring-arg-names
Open

docs: fix docstring Args entries that name a parameter the function does not take#5685
darkdi wants to merge 1 commit into
bentoml:mainfrom
darkdi:fix/docstring-arg-names

Conversation

@darkdi

@darkdi darkdi commented Aug 6, 2026

Copy link
Copy Markdown

Forty Args: entries name a parameter the function does not take. Docstrings only — no signature, no behaviour, no test touched.

The largest group is in io_descriptors. Every _from_sample there takes exactly (self, sample), but the docstrings still list the constructor keywords alongside it — enforce_dtype, enforce_shape, apply_column_names, orient, default_format, pilmode, mime_type, allowed_mime_types, kind, json_encoder, **kwargs. In PandasSeries._from_sample the one real argument was documented under the old name sample_input, so that became sample rather than being dropped.

Also in io_descriptors: all three from_proto methods take field but document request and context, and both _to_proto_impl methods document a context they do not receive.

Ten are renames:

Where Documented Actual
from_proto (numpy, pandas ×2) request field
PandasSeries._from_sample sample_input sample
ModelAPI.get tag name
fastai.save_model learner learner_
pytorch_lightning.load_model, torchscript.load_model tag bentoml_model
Model.to_runner runnable_method_configs method_configs
host_bento bento bento_name

The rest document something that is not an argument: model_store on the two pytorch_lightning entry points, backend on OCIBuilder.__init__, grpc on get_metrics_report, columns and apply_column_names on the PandasSeries class, and tag on import_bento and import_model — the last two copied from the matching export_* functions, which do take a tag.

Every entry was opened and read against its signature. ruff check and ruff format --check pass on all sixteen files with the pinned ruff==0.15.12 from .pre-commit-config.yaml.

@darkdi
darkdi requested a review from a team as a code owner August 6, 2026 09:31
@darkdi
darkdi requested review from jianshen92 and removed request for a team August 6, 2026 09:31
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