Skip to content

Commit f85e296

Browse files
committed
Give Warning on prefix pandas
1 parent 5dd4cae commit f85e296

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

scripts/tests/test_validate_docstrings.py

+11
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ def method(self, foo=None, bar=None):
334334
pass
335335

336336

337+
class BadSeeAlso(object):
338+
339+
def prefix_pandas(self):
340+
"""
341+
Return prefix with `pandas` from See Also sec
342+
"""
343+
pass
344+
337345
class BadSummaries(object):
338346

339347
def wrong_line(self):
@@ -608,6 +616,9 @@ def test_bad_generic_functions(self, func):
608616
assert errors
609617

610618
@pytest.mark.parametrize("klass,func,msgs", [
619+
#SeeAlso tests
620+
('BadSeeAlso', 'prefix_pandas',
621+
('Should not start with pandas',)),
611622
# Summary tests
612623
('BadSummaries', 'wrong_line',
613624
('should start in the line immediately after the opening quotes',)),

scripts/validate_docstrings.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@ def validate_one(func_name):
508508
if not rel_desc:
509509
errs.append('Missing description for '
510510
'See Also "{}" reference'.format(rel_name))
511-
511+
if rel_name[:7].lower() == 'pandas.':
512+
errs.append('{} should not have prefix `pandas`'.format(rel_name))
512513
for line in doc.raw_doc.splitlines():
513514
if re.match("^ *\t", line):
514515
errs.append('Tabs found at the start of line "{}", '

0 commit comments

Comments
 (0)