Skip to content

BUG: AttributeError in scripts/validate_docstrings for doc.returns[0].name #27622

Closed
@albertvillanova

Description

@albertvillanova

Code Sample, a copy-pastable example if possible

python scripts/validate_docstrings.py pandas.Series.item
Traceback (most recent call last):
  File "scripts/validate_docstrings.py", line 1047, in <module>
    args.ignore_deprecated,
  File "scripts/validate_docstrings.py", line 969, in main
    result = validate_one(func_name)
  File "scripts/validate_docstrings.py", line 836, in validate_one
    errs, wrns, examples_errs = get_validation_data(doc)
  File "scripts/validate_docstrings.py", line 760, in get_validation_data
    if len(doc.returns) == 1 and doc.returns[0].name:
AttributeError: 'tuple' object has no attribute 'name'

Problem description

I get an AttributeError when running the script.

Expected Output

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions