From d3b84a2fc6c30b93aa31724f80194f31fc9dcffd Mon Sep 17 00:00:00 2001 From: gfyoung Date: Wed, 15 Nov 2017 21:22:37 -0800 Subject: [PATCH 1/3] MAINT: Blacklist np.array_equal in tests Follow-up to gh-18087. --- ci/lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/lint.sh b/ci/lint.sh index c26b5f00d5a48..f286b497de54a 100755 --- a/ci/lint.sh +++ b/ci/lint.sh @@ -72,7 +72,7 @@ if [ "$LINT" ]; then echo "Linting *.c and *.h DONE" echo "Check for invalid testing" - grep -r -E --include '*.py' --exclude testing.py '(numpy|np)\.testing' pandas + grep -r -E --include '*.py' --exclude testing.py '(numpy|np)\.testing|(numpy|np)\.array_equal' pandas/tests if [ $? = "0" ]; then RET=1 fi From feb6f5afc5a238a960633cb4efc1d9cfd557a892 Mon Sep 17 00:00:00 2001 From: gfyoung Date: Wed, 15 Nov 2017 21:26:31 -0800 Subject: [PATCH 2/3] MAINT: Remove remaining np.array_equal in tests Test that uses the function call uses functionality that doesn't exist anymore in pandas. --- pandas/tests/internals/test_internals.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/pandas/tests/internals/test_internals.py b/pandas/tests/internals/test_internals.py index c182db35c0c89..4c0c7d8598a8e 100644 --- a/pandas/tests/internals/test_internals.py +++ b/pandas/tests/internals/test_internals.py @@ -286,29 +286,6 @@ def test_delete(self): with pytest.raises(Exception): newb.delete(3) - def test_split_block_at(self): - - # with dup column support this method was taken out - # GH3679 - pytest.skip("skipping for now") - - bs = list(self.fblock.split_block_at('a')) - assert len(bs) == 1 - assert np.array_equal(bs[0].items, ['c', 'e']) - - bs = list(self.fblock.split_block_at('c')) - assert len(bs) == 2 - assert np.array_equal(bs[0].items, ['a']) - assert np.array_equal(bs[1].items, ['e']) - - bs = list(self.fblock.split_block_at('e')) - assert len(bs) == 1 - assert np.array_equal(bs[0].items, ['a', 'c']) - - # bblock = get_bool_ex(['f']) - # bs = list(bblock.split_block_at('f')) - # assert len(bs), 0) - class TestDatetimeBlock(object): From 6bd5f3c2f293757bb85c8a9c9264c0b06ad05eab Mon Sep 17 00:00:00 2001 From: gfyoung Date: Thu, 16 Nov 2017 09:34:19 -0800 Subject: [PATCH 3/3] MAINT: Address reviewer comments --- ci/lint.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/lint.sh b/ci/lint.sh index f286b497de54a..71d8c5c7e1621 100755 --- a/ci/lint.sh +++ b/ci/lint.sh @@ -72,7 +72,13 @@ if [ "$LINT" ]; then echo "Linting *.c and *.h DONE" echo "Check for invalid testing" - grep -r -E --include '*.py' --exclude testing.py '(numpy|np)\.testing|(numpy|np)\.array_equal' pandas/tests + + # Check for the following code in testing: + # + # np.testing + # np.array_equal + grep -r -E --include '*.py' --exclude testing.py '(numpy|np)(\.testing|\.array_equal)' pandas/tests/ + if [ $? = "0" ]; then RET=1 fi