You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by jo...@apache.org on 2023/07/10 09:06:17 UTC

[arrow] branch main updated: GH-36541: [Python][CI] Fixup nopandas build after merge of GH-33321 (#36586)

This is an automated email from the ASF dual-hosted git repository.

jorisvandenbossche pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1040e2c3b5 GH-36541: [Python][CI] Fixup nopandas build after merge of GH-33321 (#36586)
1040e2c3b5 is described below

commit 1040e2c3b5f668efa75516f9aa91476b5b736c37
Author: Joris Van den Bossche <jo...@gmail.com>
AuthorDate: Mon Jul 10 11:06:10 2023 +0200

    GH-36541: [Python][CI] Fixup nopandas build after merge of GH-33321 (#36586)
    
    See https://github.com/apache/arrow/pull/35656/files#r1257540254
    
    https://github.com/apache/arrow/pull/36542 fixed the no-pandas build by actually not having pandas installed, but some PRs merged at the same time introduced new failures for this build.
    * Closes: #36541
    
    Authored-by: Joris Van den Bossche <jo...@gmail.com>
    Signed-off-by: Joris Van den Bossche <jo...@gmail.com>
---
 python/pyarrow/tests/test_pandas.py | 19 +++++++++----------
 python/pyarrow/tests/test_schema.py |  1 +
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/python/pyarrow/tests/test_pandas.py b/python/pyarrow/tests/test_pandas.py
index cf71b8b82d..8bdc7253a4 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():
diff --git a/python/pyarrow/tests/test_schema.py b/python/pyarrow/tests/test_schema.py
index 2f2417f590..2c2f9547f2 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"):