Skip to content

Commit e53967b

Browse files
Backport PR #60635 on branch 2.3.x (TST(string dtype): Resolve xfail for corrwith) (#60644)
Backport PR #60635: TST(string dtype): Resolve xfail for corrwith Co-authored-by: Richard Shadrach <[email protected]>
1 parent 928d221 commit e53967b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pandas/tests/frame/methods/test_cov_corr.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
from pandas._config import using_string_dtype
5-
64
import pandas.util._test_decorators as td
75

86
import pandas as pd
@@ -328,7 +326,6 @@ def test_corrwith(self, datetime_frame, dtype):
328326
for row in index[:4]:
329327
tm.assert_almost_equal(correls[row], df1.loc[row].corr(df2.loc[row]))
330328

331-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
332329
def test_corrwith_with_objects(self, using_infer_string):
333330
df1 = DataFrame(
334331
np.random.default_rng(2).standard_normal((10, 4)),
@@ -342,9 +339,8 @@ def test_corrwith_with_objects(self, using_infer_string):
342339
df2["obj"] = "bar"
343340

344341
if using_infer_string:
345-
import pyarrow as pa
346-
347-
with pytest.raises(pa.lib.ArrowNotImplementedError, match="has no kernel"):
342+
msg = "Cannot perform reduction 'mean' with string dtype"
343+
with pytest.raises(TypeError, match=msg):
348344
df1.corrwith(df2)
349345
else:
350346
with pytest.raises(TypeError, match="Could not convert"):

0 commit comments

Comments
 (0)