question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unclear error statement printed when `python ./scripts/validate_docstrings.py --errors=PR02` is run

See original GitHub issue

When I run python ./scripts/validate_docstrings.py --errors=PR02, one of the error statements printed is /home/pandas/pandas/core/generic.py:1092:PR02:pandas.DataFrame.rename_axis:Unknown parameters {'inplace'}. However in the generic.py file, “inplace” is declared in the function, overloaded functions, and the doc-string, so I was unsure what the error statement meant.

Screenshot 2022-08-11 182455 Screenshot 2022-08-11 182512

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MarcoGorellicommented, Aug 22, 2022

Thanks - where is it needed? Aren’t the overloads enough? e.g.

(pandas-dev) marco@marco-Predator-PH315-52:~/pandas-marco$ cat t.py 
import pandas as pd

df = pd.DataFrame({'a': [1,2,3]})

reveal_type(df.rename_axis(index='foo'))
reveal_type(df.rename_axis(index='foo', inplace=True))
(pandas-dev) marco@marco-Predator-PH315-52:~/pandas-marco$ mypy t.py 
t.py:5: note: Revealed type is "pandas.core.frame.DataFrame"
t.py:6: note: Revealed type is "None"
Success: no issues found in 1 source file
0reactions
twoertweincommented, Aug 22, 2022

Aren’t the overloads enough?

That’s a good point! The overloads might actually be enough. When a function has overloads, the implementation is not actually used for type checking (there might be some consistency checks between overloads and implementation but you could add an ignore comment if needed).

Read more comments on GitHub >

github_iconTop Results From Across the Web

8. Errors and Exceptions — Python 3.11.1 documentation
The last line of the error message indicates what happened. Exceptions come in different types, and the type is printed as part of...
Read more >
why my errors come first and print statements come second in ...
This behavior happens because stdout is buffered and stderr is not, for performance reasons. It means that there can be delay when you...
Read more >
Invalid Syntax in Python: Common Reasons for SyntaxError
The error message that comes after the exception type SyntaxError , which can provide information to help you determine the problem. In the...
Read more >
How to Print to the Standard Error Stream in Python
Printing to Python's standard error stream will help you better manage handling any errors ... print ( 'Error message' , file = sys.stderr) ......
Read more >
Python: How to Print Without Newline? - STechies
As Python prints every output on a different line by default, you might get confused. The Problem. Printing the output is probably the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found