Skip to content

Commit 3a8597e

Browse files
author
Kei
committed
Fix tests with nested array
1 parent 680e238 commit 3a8597e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/tests/groupby/test_groupby.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
)
2929
import pandas._testing as tm
3030
from pandas.core.arrays import BooleanArray
31+
from pandas.core.arrays.string_arrow import ArrowStringArrayNumpySemantics
3132
import pandas.core.common as com
3233

3334
pytestmark = pytest.mark.filterwarnings("ignore:Mean of empty slice:RuntimeWarning")
@@ -2476,9 +2477,14 @@ def test_by_column_values_with_same_starting_value(dtype):
24762477
"Mood": [["happy", "sad"], "happy"],
24772478
"Credit": [2500, 900],
24782479
"Name": ["Thomas", "Thomas John"],
2479-
}
2480+
},
24802481
).set_index("Name")
2482+
if dtype == "string[pyarrow_numpy]":
2483+
import pyarrow as pa
24812484

2485+
mood_values = ArrowStringArrayNumpySemantics(pa.array(["happy", "sad"]))
2486+
expected_result["Mood"] = [mood_values, "happy"]
2487+
expected_result["Mood"] = expected_result["Mood"].astype(dtype)
24822488
tm.assert_frame_equal(result, expected_result)
24832489

24842490

0 commit comments

Comments
 (0)