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
Merged

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

merged 9 commits into from
Oct 12, 2022

Conversation

roadswitcher
Copy link
Contributor

Found one instance of a test that's deliberately returning an Iterator to fool is_file_like, suppressing the warning as a false positive based on nature of test.

@roadswitcher roadswitcher changed the title Find and fix or suppress non-iterator-returned errors from pylint STYLE: Fix or suppress non-iterator-returned errors from pylint Oct 10, 2022
@@ -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.

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Oct 11, 2022
@mroeschke mroeschke added this to the 1.6 milestone Oct 12, 2022
@mroeschke mroeschke merged commit 060536d into pandas-dev:main Oct 12, 2022
@mroeschke
Copy link
Member

Thanks @roadswitcher

@roadswitcher roadswitcher deleted the check_non_iterator_returned branch October 12, 2022 18:27
@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
…as-dev#49036)

* Working on finding issues with non-iterator-returned

* Found one instance to suppress

* Misread the error message, suppressed wrong line.

* Change test so that pylint treats it as iterator

* Fix formatting.

* Added reference to PR in comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants