Skip to content

Commit 8e18ee0

Browse files
fix minor issues
1 parent 7ec0b5f commit 8e18ee0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pandas/core/strings/accessor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2482,9 +2482,11 @@ def get_dummies(
24822482
1 False False False
24832483
2 True False True
24842484
"""
2485+
from pandas.core.dtypes.common import is_string_dtype
2486+
24852487
from pandas.core.frame import DataFrame
24862488

2487-
if dtype in (str, "str[pyarrow]"):
2489+
if is_string_dtype(dtype):
24882490
raise ValueError("string dtype not supported, please use a numeric dtype")
24892491
# we need to cast to Series of strings as only that has all
24902492
# methods available for making the dummies...

pandas/tests/strings/test_get_dummies.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
_testing as tm,
1212
)
1313

14-
try:
15-
import pyarrow as pa
16-
except ImportError:
17-
pa = None
18-
1914

2015
def test_get_dummies(any_string_dtype):
2116
s = Series(["a|b", "a|c", np.nan], dtype=any_string_dtype)

0 commit comments

Comments
 (0)