Skip to content

Commit

Permalink
Fix tests with nested array
Browse files Browse the repository at this point in the history
  • Loading branch information
Kei committed Apr 29, 2024
1 parent 680e238 commit 3a8597e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pandas/tests/groupby/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
)
import pandas._testing as tm
from pandas.core.arrays import BooleanArray
from pandas.core.arrays.string_arrow import ArrowStringArrayNumpySemantics
import pandas.core.common as com

pytestmark = pytest.mark.filterwarnings("ignore:Mean of empty slice:RuntimeWarning")
Expand Down Expand Up @@ -2476,9 +2477,14 @@ def test_by_column_values_with_same_starting_value(dtype):
"Mood": [["happy", "sad"], "happy"],
"Credit": [2500, 900],
"Name": ["Thomas", "Thomas John"],
}
},
).set_index("Name")
if dtype == "string[pyarrow_numpy]":
import pyarrow as pa

mood_values = ArrowStringArrayNumpySemantics(pa.array(["happy", "sad"]))
expected_result["Mood"] = [mood_values, "happy"]
expected_result["Mood"] = expected_result["Mood"].astype(dtype)
tm.assert_frame_equal(result, expected_result)


Expand Down

0 comments on commit 3a8597e

Please sign in to comment.