Skip to content

Commit edbd479

Browse files
Develop pre check (#38663)
* Add the check-no-pd-class hook * make check more generic * change instance of pd.testing in test class * Update .pre-commit-config.yaml * Add wildcard to entry in pre-commit config file * Add check to import test check * Update .pre-commit-config.yaml Co-authored-by: Marco Gorelli <[email protected]> Co-authored-by: Marco Gorelli <[email protected]>
1 parent bc29dfb commit edbd479

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.pre-commit-config.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ repos:
8989
# No direct imports from conftest
9090
conftest\ import|
9191
import\ conftest
92+
93+
# Check for use of pandas.testing instead of tm
94+
pd\.testing\.
9295
types: [python]
9396
files: ^pandas/tests/
9497
- id: incorrect-code-directives

pandas/tests/groupby/aggregate/test_aggregate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ def test_groupby_get_by_index():
10491049
df = DataFrame({"A": ["S", "W", "W"], "B": [1.0, 1.0, 2.0]})
10501050
res = df.groupby("A").agg({"B": lambda x: x.get(x.index[-1])})
10511051
expected = DataFrame({"A": ["S", "W"], "B": [1.0, 2.0]}).set_index("A")
1052-
pd.testing.assert_frame_equal(res, expected)
1052+
tm.assert_frame_equal(res, expected)
10531053

10541054

10551055
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)