Skip to content

Commit 8f3c6d5

Browse files
authored
Backport PR #61744 on branch 2.3.x (CI: if no docstring, create error GL08 and don't validate - fix for numpydoc 1.9) (#61745)
CI: if no docstring, create error GL08 and don't validate - fix for numpydoc 1.9 (#61744) * if no docstring, create error GL08 and don't validate * add file and file_line as None if no docstring (cherry picked from commit 30a2e7f)
1 parent 7096342 commit 8f3c6d5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/validate_docstrings.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,15 @@ def pandas_validate(func_name: str):
269269
# Some objects are instances, e.g. IndexSlice, which numpydoc can't validate
270270
doc_obj = get_doc_object(func_obj, doc=func_obj.__doc__)
271271
doc = PandasDocstring(func_name, doc_obj)
272-
result = validate(doc_obj)
273-
272+
if func_obj.__doc__ is not None:
273+
result = validate(doc_obj)
274+
else:
275+
result = {
276+
"docstring": "",
277+
"file": None,
278+
"file_line": None,
279+
"errors": [("GL08", "The object does not have a docstring")],
280+
}
274281
mentioned_errs = doc.mentioned_private_classes
275282
if mentioned_errs:
276283
result["errors"].append(

0 commit comments

Comments
 (0)