-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
STY: add code check for use of builtin filter function #36089
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
Conversation
@@ -179,6 +179,10 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then | |||
invgrep -R --include="*.py" -E "super\(\w*, (self|cls)\)" pandas | |||
RET=$(($RET + $?)) ; echo $MSG "DONE" | |||
|
|||
MSG='Check for use of builtin filter function' ; echo $MSG | |||
invgrep -R --include="*.py" -P '(?<!def)[\(\s]filter\(' pandas |
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.
invgrep -R --include="*.py" -P '(?<!def)[\(\s]filter\(' pandas | |
invgrep -R --include="*.py" -P '(?<!def )filter\(' pandas |
Is this necessary?
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.
that would fail on uses of .filter
, simplefilter
, .apply_filter
and more
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.
looks good. potentially could simplify the regex otherwise @jreback
LGTM |
thanks @simonjayhawkins |
xref #35717 (comment)