Skip to content

Commit 0647711

Browse files
author
Kei
committed
Update test_aggregate tests
1 parent 64330f0 commit 0647711

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/tests/groupby/aggregate/test_aggregate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,11 @@ def test_agg_lambda_object_pyarrow_dtype_conversion():
19831983
expected = DataFrame(
19841984
{"A": ["c1", "c2", "c3"], "B": [{"number": 1}, {"number": 1}, {"number": 1}]}
19851985
)
1986-
expected["B"] = expected["B"].astype("object")
1986+
import pyarrow as pa
1987+
1988+
pyarrow_type = pa.struct({"number": pa.int64()})
1989+
pandas_pyarrow_dtype = pd.ArrowDtype(pyarrow_type)
1990+
expected["B"] = expected["B"].astype(pandas_pyarrow_dtype)
19871991
expected.set_index("A", inplace=True)
19881992

19891993
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)