Skip to content

Commit 3bc44d4

Browse files
authored
TST(string dtype): Resolve xfail for corrwith (#60635)
1 parent 9d2d770 commit 3bc44d4

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
@@ -320,7 +318,6 @@ def test_corrwith_non_timeseries_data(self):
320318
for row in index[:4]:
321319
tm.assert_almost_equal(correls[row], df1.loc[row].corr(df2.loc[row]))
322320

323-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
324321
def test_corrwith_with_objects(self, using_infer_string):
325322
df1 = DataFrame(
326323
np.random.default_rng(2).standard_normal((10, 4)),
@@ -334,9 +331,8 @@ def test_corrwith_with_objects(self, using_infer_string):
334331
df2["obj"] = "bar"
335332

336333
if using_infer_string:
337-
import pyarrow as pa
338-
339-
with pytest.raises(pa.lib.ArrowNotImplementedError, match="has no kernel"):
334+
msg = "Cannot perform reduction 'mean' with string dtype"
335+
with pytest.raises(TypeError, match=msg):
340336
df1.corrwith(df2)
341337
else:
342338
with pytest.raises(TypeError, match="Could not convert"):

0 commit comments

Comments
 (0)