Skip to content

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

Merged
merged 1 commit into from
Sep 5, 2020

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins added the Code Style Code style, linting, code_checks label Sep 3, 2020
@@ -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
Copy link
Member

@WillAyd WillAyd Sep 3, 2020

Choose a reason for hiding this comment

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

Suggested change
invgrep -R --include="*.py" -P '(?<!def)[\(\s]filter\(' pandas
invgrep -R --include="*.py" -P '(?<!def )filter\(' pandas

Is this necessary?

Copy link
Member Author

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

Copy link
Member

@WillAyd WillAyd left a 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

@simonjayhawkins simonjayhawkins added this to the 1.2 milestone Sep 3, 2020
@jbrockmendel
Copy link
Member

LGTM

@jreback jreback merged commit 6f45304 into pandas-dev:master Sep 5, 2020
@jreback
Copy link
Contributor

jreback commented Sep 5, 2020

thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the filter-code-check branch September 5, 2020 07:30
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Sep 8, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
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.

4 participants