Skip to content

Commit 11a7ed0

Browse files
committed
TST(string dtype): Resolve xfail for corrwith
1 parent 8fbe6ac commit 11a7ed0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pandas/tests/frame/methods/test_cov_corr.py

Lines changed: 3 additions & 6 deletions
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,7 @@ 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)")
321+
# @pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
324322
def test_corrwith_with_objects(self, using_infer_string):
325323
df1 = DataFrame(
326324
np.random.default_rng(2).standard_normal((10, 4)),
@@ -334,9 +332,8 @@ def test_corrwith_with_objects(self, using_infer_string):
334332
df2["obj"] = "bar"
335333

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

0 commit comments

Comments
 (0)