Skip to content

TST(string dtype): Resolve xfail for corrwith #60635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading