Skip to content

Commit 075ec87

Browse files
authored
ban np.testing (#43971)
1 parent 218e55f commit 075ec87

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ repos:
135135
entry: 'np\.random\.seed'
136136
files: ^asv_bench/benchmarks
137137
exclude: ^asv_bench/benchmarks/pandas_vb_common\.py
138+
- id: np-testing-array-equal
139+
name: Check for usage of numpy testing or array_equal
140+
language: pygrep
141+
entry: '(numpy|np)(\.testing|\.array_equal)'
142+
files: ^pandas/tests/
143+
types: [python]
138144
- id: invalid-ea-testing
139145
name: Check for invalid EA testing
140146
language: pygrep

pandas/tests/arrays/sparse/test_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ def test_to_coo(
12561256
row_levels=(0, 1), column_levels=(2, 3), sort_labels=sort_labels
12571257
)
12581258
assert isinstance(A, scipy.sparse.coo.coo_matrix)
1259-
np.testing.assert_array_equal(A.toarray(), expected_A)
1259+
tm.assert_numpy_array_equal(A.toarray(), expected_A)
12601260
assert rows == expected_rows
12611261
assert cols == expected_cols
12621262

0 commit comments

Comments
 (0)