Skip to content

DOC: Validate that the docstrings do not import pandas or numpy #23134

Closed
@datapythonista

Description

@datapythonista

scripts/validate_docstrings.py validates that the content of a docstring follows our standards. There are still some of those standards that the script does not validate, and this gives the users the wrong impression that the docstring is all right, when it's not really the case. All the missing validations are listed in #20298.

One of those standards is that we do not show the import numpy as np or import pandas as pd in the examples section, but we assume it's there. We should automatically validate that these imports do not exist in the examples.

For this issue is required:

  • Change scripts/validate_docstings.py to give an error if the imports are found
  • Add tests in scripts/tests/test_validate_docstrings.py
  • Run the script for all docstrings (i.e. ./scripts/validate_docstings.py) and check in the resulting report how many of the docstrings in pandas have these imports. If any, remove them in the same PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions