Fix AttributeError in scripts/validate_docstrings for doc.returns[0].name
- [X] closes #27622
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

can you add some tests for this What version of numpydoc is this? IIRC they have been using named tuples in more recent versions which is preferable from a readability perspective. Does upgrading resolve your issue? @WillAyd, yes you are right: since numpydoc version 0.9, they use a Parameter named tuple (https://github.com/numpy/numpydoc/commit/136d4dd75207f529078c5c47dc4db53d0f38b4bf); I have v0.8.0 in my pandas dev environment. I’d prefer to just bump our min version here for readability. Still pretty new (0.9 came out in April) but I think OK for a dev dependency.

> On Jul 27, 2019, at 11:51 AM, Albert Villanova del Moral <notifications@github.com> wrote:
> 
> @WillAyd <https://github.com/WillAyd>, yes you are right: since numpydoc version 0.9, they use a Parameter named tuple (numpy/numpydoc@136d4dd <https://github.com/numpy/numpydoc/commit/136d4dd75207f529078c5c47dc4db53d0f38b4bf>); I have v0.8.0 in my pandas dev environment.
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub <https://github.com/pandas-dev/pandas/pull/27623?email_source=notifications&email_token=AAEU4UM33HN2YFO5B7QNOGDQBSKK3A5CNFSM4IHJA6T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26QV4Y#issuecomment-515705587>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAEU4UMM73AGIPD7L2V5KK3QBSKK3ANCNFSM4IHJA6TQ>.
> 

 > Still pretty new (0.9 came out in April) but I think OK for a dev dependency.

I'm in agreement on this.  We can be a little more aggressive for development dependencies. We actually already do require this in environment.yaml per #26188 so I don't think anything to do here (unless we care to document further) > I don't think anything to do here 

I'm agreement with this.

@albertvillanova : I'm closing this because the fix is just to upgrade to `numpydoc` per the new requirements on `master`.  Thanks for contributing though!  You are more than welcome to tackle any of our other open issues in our issue tracker. Yes, I had noticed the version requirement in environment.yaml.

@gfyoung @WillAyd What about documenting how to update the dev environment in Contributing section? When you say document, what would you add about upgrading?  It’s just doing a `pip` or `conda` upgrade, no? You have thoroughly documented the creation of the dev environment using the environment.yaml file. However nothing is said about updating it (using the environment.yaml, which might have changed since the last time, with new packages or new version requirements). Nevertheless, if you think it is OK as it is... Nevermind! > Nevertheless, if you think it is OK as it is... Nevermind!

Not saying that I think it's OK as is.  I'm just trying to understand what you wanted to do.

Why don't you submit a PR, and we can better evaluate.