Skip to content

Consider directives when validating docstrings parameters #22405

Closed
@datapythonista

Description

@datapythonista

When running the docstring validation script, errors are mistakenly reported if parameters have a deprecated, versionadded or versionchanged directive.

For example, when running ./scripts/validate_docstrings.py pandas.DataFrame.mode, the next error is returned by the script:

################################################################################
################################## Validation ##################################
################################################################################

Errors found:
	Errors in parameters section
		Parameter "dropna" description should finish with "."

But the dropna parameter description does finish with a period:

dropna : bool, default True
    Don't consider counts of NaN/NaT.

    .. versionadded:: 0.24.0

The problem is that the .. versionadded:: directive is not considered.

The script should ignore the directive when validating, and shouldn't report the error in this case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions