Skip to content

Commit

Permalink
TST(string dtype): Resolve xfail for corrwith (#60635)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhshadrach authored Jan 2, 2025
1 parent 9d2d770 commit 3bc44d4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pandas/tests/frame/methods/test_cov_corr.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import numpy as np
import pytest

from pandas._config import using_string_dtype

import pandas.util._test_decorators as td

import pandas as pd
Expand Down Expand Up @@ -320,7 +318,6 @@ def test_corrwith_non_timeseries_data(self):
for row in index[:4]:
tm.assert_almost_equal(correls[row], df1.loc[row].corr(df2.loc[row]))

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

if using_infer_string:
import pyarrow as pa

with pytest.raises(pa.lib.ArrowNotImplementedError, match="has no kernel"):
msg = "Cannot perform reduction 'mean' with string dtype"
with pytest.raises(TypeError, match=msg):
df1.corrwith(df2)
else:
with pytest.raises(TypeError, match="Could not convert"):
Expand Down

0 comments on commit 3bc44d4

Please sign in to comment.