Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: fix docstring validation errors for pandas.core and pandas.errors #60575

Closed
sunlight798 opened this issue Dec 15, 2024 · 0 comments
Closed

Comments

@sunlight798
Copy link
Contributor

follow up on issues #59698, #59458 and #58063 pandas has a script for validating docstrings:

pandas/ci/code_checks.sh

Lines 86 to 100 in b0192c7

-i "pandas.core.groupby.DataFrameGroupBy.plot PR02" \
-i "pandas.core.groupby.SeriesGroupBy.plot PR02" \
-i "pandas.core.resample.Resampler.max PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.mean SA01" \
-i "pandas.core.resample.Resampler.min PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.prod SA01" \
-i "pandas.core.resample.Resampler.quantile PR01,PR07" \
-i "pandas.core.resample.Resampler.std SA01" \
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.var SA01" \
-i "pandas.errors.UndefinedVariableError PR01,SA01" \
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \
-i "pandas.plotting.andrews_curves RT03,SA01" \
-i "pandas.plotting.scatter_matrix PR07,SA01" \

Currently, some methods fail docstring validation check. The task here is:

  • take 2-4 methods
  • run: scripts/validate_docstrings.py <method-name>
  • run pytest pandas/tests/scalar/test_nat.py::test_nat_doc_strings
  • fix the docstrings according to whatever error is reported
  • remove those methods from code_checks.sh script
  • commit, push, open pull request

Example:

 scripts/validate_docstrings.py pandas.Timedelta.ceil

pandas.Timedelta.ceil fails with the SA01 and ES01 errors

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

2 Errors found for `pandas.Timedelta.ceil`:
        ES01    No extended summary found
        SA01    See Also section not found

Please don't comment take as multiple people can work on this issue. You also don't need to ask for permission to work on this, just comment on which methods are you going to work.

If you're new contributor, please check the contributing guide

thanks @natmokval for giving me the idea for this issue.

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

No branches or pull requests

1 participant