From 7f10e72d07e6f600d2f6a527c1e89d88464a0e7b Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 22 Aug 2024 15:48:52 -0700 Subject: [PATCH] update message --- pandas/tests/groupby/test_raises.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandas/tests/groupby/test_raises.py b/pandas/tests/groupby/test_raises.py index e2ca6b08a84780..d4c135a0620527 100644 --- a/pandas/tests/groupby/test_raises.py +++ b/pandas/tests/groupby/test_raises.py @@ -219,7 +219,13 @@ def test_groupby_raises_string( elif groupby_func in ["cummin", "cummax"]: msg = msg.replace("object", "str") elif groupby_func == "corrwith": - msg = "'.*NumpySemantics' with dtype str does not support operation 'mean'" + if df["d"].dtype.storage == "pyarrow": + msg = ( + "ArrowStringArrayNumpySemantics' with dtype str does not " + "support operation 'mean'" + ) + else: + msg = "Cannot perform reduction 'mean' with string dtype" if groupby_func == "fillna": kind = "Series" if groupby_series else "DataFrame"