Skip to content

STYLE: Fix or suppress non-iterator-returned errors from pylint #49036

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

Merged
merged 9 commits into from
Oct 12, 2022
2 changes: 2 additions & 0 deletions pandas/tests/io/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,8 @@ def seek(self, offset):
def seekable(self):
return True

# GH 48855 suppressing false positives
# pylint: disable-next=non-iterator-returned
Copy link
Member

Choose a reason for hiding this comment

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

Can this be corrected such that the check and existing test passes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll give that a shot this evening.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After reviewing #17975 ( issue prompting this test), I added __next__ and changed __iter__ to remove the warning from pylint while letting existing test pass.

def __iter__(self) -> Iterator:
# to fool `is_file_like`, should never end up here
assert False
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ disable = [
"no-method-argument",
"no-name-in-module",
"no-value-for-parameter",
"non-iterator-returned",
"not-an-iterable",
"not-callable",
"redundant-keyword-arg",
Expand Down