From f2ac5c75ddd6c3bc8e9e737dad253701c39ed4a4 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 12 Jun 2024 09:52:29 +0200 Subject: [PATCH] fix numpy version check for array protocol tests --- python/pyarrow/tests/test_array.py | 2 +- python/pyarrow/tests/test_table.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyarrow/tests/test_array.py b/python/pyarrow/tests/test_array.py index 88394c77e429d..1032ab9add3ca 100644 --- a/python/pyarrow/tests/test_array.py +++ b/python/pyarrow/tests/test_array.py @@ -3398,7 +3398,7 @@ def test_numpy_array_protocol(): result = np.asarray(arr) np.testing.assert_array_equal(result, expected) - if Version(np.__version__) < Version("2.0"): + if Version(np.__version__) < Version("2.0.0.dev0"): # copy keyword is not strict and not passed down to __array__ result = np.array(arr, copy=False) np.testing.assert_array_equal(result, expected) diff --git a/python/pyarrow/tests/test_table.py b/python/pyarrow/tests/test_table.py index a58010d083e92..f40759de50c8c 100644 --- a/python/pyarrow/tests/test_table.py +++ b/python/pyarrow/tests/test_table.py @@ -3281,7 +3281,7 @@ def test_numpy_array_protocol(constructor): table = constructor([[1, 2, 3], [4.0, 5.0, 6.0]], names=["a", "b"]) expected = np.array([[1, 4], [2, 5], [3, 6]], dtype="float64") - if Version(np.__version__) < Version("2.0"): + if Version(np.__version__) < Version("2.0.0.dev0"): # copy keyword is not strict and not passed down to __array__ result = np.array(table, copy=False) np.testing.assert_array_equal(result, expected)