Skip to content

Commit dbd42fc

Browse files
author
Peter Hamfelt
committed
Add pandas inplace checker
1 parent 7046db8 commit dbd42fc

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

pylint_ml/checkers/pandas/pandas_inplace.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,17 @@ class PandasInplaceChecker(BaseChecker):
2424
}
2525

2626
_inplace_methods = {
27-
"drop", "fillna", "replace", "rename", "set_index", "reset_index",
28-
"sort_values", "sort_index", "drop_duplicates", "update", "clip"
27+
"drop",
28+
"fillna",
29+
"replace",
30+
"rename",
31+
"set_index",
32+
"reset_index",
33+
"sort_values",
34+
"sort_index",
35+
"drop_duplicates",
36+
"update",
37+
"clip",
2938
}
3039

3140
@only_required_for_messages("pandas-inplace")

tests/checkers/test_pandas/test_pandas_inplace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,6 @@ def test_inplace_used_in_unsupported_method(self):
9999
df.append({"A": 4, "B": 7}, inplace=True) # This should not trigger any warnings
100100
"""
101101
)
102-
102+
103103
with self.assertNoMessages():
104104
self.checker.visit_call(node)

0 commit comments

Comments
 (0)