-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Description
The public documentation shouldn't mention private classes, which the users are not expected to know about, and they could be removed in the future without proper deprecation.
We've got a script to find them, it can be run with ./scripts/validate_docstrings.py --errors=GL04
Currently there are those cases:
pandas.Series.pipe: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.Series.where: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.Series.mask: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.Series.first_valid_index: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.Series.last_valid_index: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.Series.tshift: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.Series.to_dense: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.core.resample.Resampler.get_group: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.DataFrame.where: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.DataFrame.mask: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.DataFrame.pipe: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.DataFrame.tshift: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.DataFrame.first_valid_index: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.DataFrame.last_valid_index: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.DataFrame.to_dense: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.core.groupby.GroupBy.get_group: Private classes (NDFrame) should not be mentioned in public docstrings
pandas.core.groupby.DataFrameGroupBy.tshift: Private classes (NDFrame) should not be mentioned in public docstrings
I'd say in most cases we can replace NDFrame by Series or DataFrame but may be we can rephrase sentences too.
After all them are corrected, we should add to ci/code_checks.sh the code GL04 to the part where we validate the documentation, so the CI checks for it, and mentions to NDFrame or other private classes are not reintroduced. Also in the same PR we can add GL05, which is not validated but there are no errors in the code for it, so we can start validating it.