Skip to content

Commit 6294417

Browse files
committed
TST: non-pyarrow build
1 parent e57fb87 commit 6294417

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pandas/tests/groupby/transform/test_transform.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from pandas._config import using_string_dtype
77

88
from pandas._libs import lib
9+
from pandas.compat import HAS_PYARROW
910

1011
from pandas.core.dtypes.common import ensure_platform_int
1112

@@ -384,7 +385,10 @@ def test_transform_nuisance_raises(df, using_infer_string):
384385
gbc = grouped["B"]
385386
msg = "Could not convert"
386387
if using_infer_string:
387-
msg = "with dtype str does not support operation 'mean'"
388+
if df.columns.dtype.storage == "pyarrow":
389+
msg = "with dtype str does not support operation 'mean'"
390+
else:
391+
msg = "Cannot perform reduction 'mean' with string dtype"
388392
with pytest.raises(TypeError, match=msg):
389393
gbc.transform(lambda x: np.mean(x))
390394

@@ -479,7 +483,10 @@ def test_groupby_transform_with_int(using_infer_string):
479483
)
480484
msg = "Could not convert"
481485
if using_infer_string:
482-
msg = "with dtype str does not support operation 'mean'"
486+
if HAS_PYARROW:
487+
msg = "with dtype str does not support operation 'mean'"
488+
else:
489+
msg = "Cannot perform reduction 'mean' with string dtype"
483490
with np.errstate(all="ignore"):
484491
with pytest.raises(TypeError, match=msg):
485492
df.groupby("A").transform(lambda x: (x - x.mean()) / x.std())

0 commit comments

Comments
 (0)