Skip to content

Commit 94535a3

Browse files
WillAydanmyachev
authored andcommitted
Fixed code issue from compat with new numpydoc (pandas-dev#26188)
1 parent fb988ce commit 94535a3

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

environment.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ dependencies:
2121
- moto
2222
- pytest>=4.0
2323
- sphinx
24-
- numpydoc
24+
- numpydoc>=0.9.0
25+
- pip
2526

2627
# optional
2728
- beautifulsoup4>=4.2.1

requirements-dev.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ isort
1212
moto
1313
pytest>=4.0
1414
sphinx
15-
numpydoc
15+
numpydoc>=0.9.0
16+
pip
1617
beautifulsoup4>=4.2.1
1718
blosc
1819
botocore>=1.11

scripts/validate_docstrings.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,12 @@ def parameter_desc(self, param):
471471

472472
@property
473473
def see_also(self):
474-
return collections.OrderedDict((name, ''.join(desc))
475-
for name, desc, _
476-
in self.doc['See Also'])
474+
result = collections.OrderedDict()
475+
for funcs, desc in self.doc['See Also']:
476+
for func, _ in funcs:
477+
result[func] = ''.join(desc)
478+
479+
return result
477480

478481
@property
479482
def examples(self):
@@ -694,7 +697,7 @@ def get_validation_data(doc):
694697
if 'return' in doc.method_source:
695698
errs.append(error('RT01'))
696699
else:
697-
if len(doc.returns) == 1 and doc.returns[0][1]:
700+
if len(doc.returns) == 1 and doc.returns[0].name:
698701
errs.append(error('RT02'))
699702
for name_or_type, type_, desc in doc.returns:
700703
if not desc:

0 commit comments

Comments
 (0)