From 9bfafb09f532e63b81967944f4391c86ea9f84e6 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 10 Jul 2023 09:01:40 +0200 Subject: [PATCH 1/2] fix parametrization without pandas --- python/pyarrow/tests/test_pandas.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/python/pyarrow/tests/test_pandas.py b/python/pyarrow/tests/test_pandas.py index cf71b8b82d6..8bdc7253a48 100644 --- a/python/pyarrow/tests/test_pandas.py +++ b/python/pyarrow/tests/test_pandas.py @@ -4258,20 +4258,19 @@ def test_to_pandas_extension_dtypes_mapping(): assert isinstance(result['a'].dtype, pd.PeriodDtype) -@pytest.mark.parametrize("arr", - [pd.period_range("2012-01-01", periods=3, freq="D").array, - pd.interval_range(1, 4).array]) -def test_array_to_pandas(arr): +def test_array_to_pandas(): if Version(pd.__version__) < Version("1.1"): pytest.skip("ExtensionDtype to_pandas method missing") - result = pa.array(arr).to_pandas() - expected = pd.Series(arr) - tm.assert_series_equal(result, expected) + for arr in [pd.period_range("2012-01-01", periods=3, freq="D").array, + pd.interval_range(1, 4).array]: + result = pa.array(arr).to_pandas() + expected = pd.Series(arr) + tm.assert_series_equal(result, expected) - result = pa.table({"col": arr})["col"].to_pandas() - expected = pd.Series(arr, name="col") - tm.assert_series_equal(result, expected) + result = pa.table({"col": arr})["col"].to_pandas() + expected = pd.Series(arr, name="col") + tm.assert_series_equal(result, expected) def test_roundtrip_empty_table_with_extension_dtype_index(): From ca2139b5a9b3fde38261fc8c5d2c1df8f9e530fe Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 10 Jul 2023 09:33:07 +0200 Subject: [PATCH 2/2] missing mark --- python/pyarrow/tests/test_schema.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/pyarrow/tests/test_schema.py b/python/pyarrow/tests/test_schema.py index 2f2417f590a..2c2f9547f22 100644 --- a/python/pyarrow/tests/test_schema.py +++ b/python/pyarrow/tests/test_schema.py @@ -50,6 +50,7 @@ def test_type_integers(): assert str(t) == name +@pytest.mark.pandas def test_type_to_pandas_dtype(): M8 = np.dtype('datetime64[ms]') if Version(pd.__version__) < Version("2.0.0"):