Skip to content

DOC: unpin numpydoc, fix validation script #39688 #41456

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

Closed
wants to merge 15 commits into from

Conversation

fangchenli
Copy link
Member

@fangchenli fangchenli commented May 13, 2021

@fangchenli
Copy link
Member Author

The breaking change was from numpy/numpydoc#302.

After modifying our script according to the new API. There is an AttributeError error:

pandas.Series.array <property object at 0x1199e99f0>
Traceback (most recent call last):
  File "scripts/validate_docstrings.py", line 438, in <module>
    main(
  File "scripts/validate_docstrings.py", line 384, in main
    return print_validate_all_results(
  File "scripts/validate_docstrings.py", line 328, in print_validate_all_results
    result = validate_all(prefix, ignore_deprecated)
  File "scripts/validate_docstrings.py", line 298, in validate_all
    doc_info = pandas_validate(func_name)
  File "scripts/validate_docstrings.py", line 241, in pandas_validate
    result["examples_errs"] = doc.examples_errors
  File "scripts/validate_docstrings.py", line 161, in examples_errors
    for test in finder.find(self.raw_doc, self.name, globs=context):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/pandas-dev/lib/python3.8/site-packages/numpydoc/validate.py", line 135, in name
    return '.'.join([self.obj.__module__, self.obj.__name__])
AttributeError: 'property' object has no attribute '__module__'

@datapythonista datapythonista added Dependencies Required and optional dependencies Docs labels May 14, 2021
@jbrockmendel
Copy link
Member

@fangchenli is this actionable?

@fangchenli fangchenli marked this pull request as ready for review June 23, 2021 01:56
@jreback jreback added this to the 1.4 milestone Jun 25, 2021
@jreback
Copy link
Contributor

jreback commented Jun 25, 2021

cc @MarcoGorelli @simonjayhawkins

@MarcoGorelli MarcoGorelli self-requested a review July 8, 2021 16:19
Comment on lines +151 to +153
except AttributeError:
if not isinstance(self.obj, property):
name = type(self.obj).__name__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't covered by any of the tests in scripts/validate_docstrings.py - when could it happen?

except AttributeError:
if not isinstance(self.obj, property):
name = type(self.obj).__name__
if name is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise, none of the tests cover when name is None - when could that happen?

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Aug 18, 2021
@mroeschke
Copy link
Member

This PR has appeared to have gone stale. Feel free to reopen if you're still interested in working on this.

@mroeschke mroeschke closed this Sep 8, 2021
@fangchenli fangchenli deleted the unpin-numpydoc branch February 4, 2022 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Required and optional dependencies Docs Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: doc-string validation broken
6 participants