-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN:Unused Variables #21974
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
CLN:Unused Variables #21974
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are some very aggressive changes here
@@ -390,7 +390,7 @@ def get_blkno_indexers(int64_t[:] blknos, bint group=True): | |||
start = 0 | |||
cur_blkno = blknos[start] | |||
|
|||
if group == False: | |||
if not group: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Group is false
@@ -15,9 +15,6 @@ def load_reduce(self): | |||
args = stack.pop() | |||
func = stack[-1] | |||
|
|||
if len(args) and type(args[0]) is type: | |||
n = args[0].__name__ # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know what this is for? “Noqa” suggests author knewflake would complain
@@ -1022,9 +1022,6 @@ def rename(self, *args, **kwargs): | |||
copy = kwargs.pop('copy', True) | |||
inplace = kwargs.pop('inplace', False) | |||
level = kwargs.pop('level', None) | |||
axis = kwargs.pop('axis', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think part of the point of this is to empty out the kwargs dict, no?
@@ -845,7 +845,6 @@ def _sqlalchemy_type(self, col): | |||
|
|||
if col_type == 'datetime64' or col_type == 'datetime': | |||
try: | |||
tz = col.tzinfo # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d assume this is a roundabout way to check for a tzinfo attribute?
I thought flake8 checked for unused variables, unreachable code. Are we using an old version or something? The set comprehensions are a good fix. Might be worth adding that flake8 plugin while you’re at it. |
I'm not sure if PyCharm is using flake8 under the hood or they have their own introspection method, but it was catching some things that flake8 wasn't. Nonetheless, I'll scale this back and break it into smaller PR's |
git diff upstream/master -u -- "*.py" | flake8 --diff
Used PyCharm inspections to check:
set([..])
to{...}