diff --git a/python/pyarrow/tests/test_array.py b/python/pyarrow/tests/test_array.py index ca063bc6b69..7a4328ce9f9 100644 --- a/python/pyarrow/tests/test_array.py +++ b/python/pyarrow/tests/test_array.py @@ -316,16 +316,15 @@ def test_to_pandas_zero_copy(): series.sum() -@pytest.mark.nopandas -@pytest.mark.pandas +@pytest.mark.numpy def test_asarray(): - # ensure this is tested both when pandas is present or not (ARROW-6564) + # Run with or without pandas (ARROW-6564). arr = pa.array(range(4)) - # The iterator interface gives back an array of Int64Scalar's + # Iteration gives Scalar objects, preserved by NumPy's object array. np_arr = np.asarray([_ for _ in arr]) - assert np_arr.tolist() == [0, 1, 2, 3] + assert [value.as_py() for value in np_arr] == [0, 1, 2, 3] assert np_arr.dtype == np.dtype('O') assert isinstance(np_arr[0], pa.Int64Scalar) diff --git a/python/pyarrow/tests/test_table.py b/python/pyarrow/tests/test_table.py index 9a2a99b4e53..f23d7b2a936 100644 --- a/python/pyarrow/tests/test_table.py +++ b/python/pyarrow/tests/test_table.py @@ -420,10 +420,9 @@ def test_to_pandas_empty_table(): tm.assert_frame_equal(result, df.iloc[:0]) -@pytest.mark.pandas -@pytest.mark.nopandas +@pytest.mark.numpy def test_chunked_array_asarray(): - # ensure this is tested both when pandas is present or not (ARROW-6564) + # Run with or without pandas (ARROW-6564). data = [ pa.array([0]),