Skip to content

Commit c72a9bf

Browse files
fixup test
1 parent cc79f34 commit c72a9bf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/tests/strings/test_get_dummies.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pandas.util._test_decorators as td
77

88
from pandas import (
9+
ArrowDtype,
910
DataFrame,
1011
Index,
1112
MultiIndex,
@@ -113,15 +114,17 @@ def test_get_dummies_with_str_dtype(any_string_dtype):
113114
# GH#47872
114115
@td.skip_if_no("pyarrow")
115116
def test_get_dummies_with_pa_str_dtype(any_string_dtype):
117+
import pyarrow as pa
118+
116119
s = Series(["a|b", "a|c", np.nan], dtype=any_string_dtype)
117-
result = s.str.get_dummies("|", dtype="string[pyarrow]")
120+
result = s.str.get_dummies("|", dtype=ArrowDtype(pa.string()))
118121
expected = DataFrame(
119122
[
120123
["true", "true", "false"],
121124
["true", "false", "true"],
122125
["false", "false", "false"],
123126
],
124127
columns=list("abc"),
125-
dtype="string[pyarrow]",
128+
dtype=ArrowDtype(pa.string()),
126129
)
127130
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)