code: def test_corrwith_with_objects(self, using_infer_string):
      df1 = DataFrame(
          np.random.default_rng(2).standard_normal((10, 4)),
          columns=Index(list("ABCD"), dtype=object),
          index=date_range("2000-01-01", periods=10, freq="B"),
      )
      df2 = df1.copy()
      cols = ["A", "B", "C", "D"]
  
      df1["obj"] = "foo"
      df2["obj"] = "bar"
  
      if using_infer_string:
          import pyarrow as pa
  
          with pytest.raises(
              pa.lib.ArrowNotImplementedError, match="has no kernel"
          ):
              df1.corrwith(df2)
      else:
          with pytest.raises(TypeError, match="Could not convert"):
              df1.corrwith(df2)
      result = df1.corrwith(df2, numeric_only=True)
      expected = df1.loc[:, cols].corrwith(df2.loc[:, cols])
      tm.assert_series_equal(result, expected)
  
      with pytest.raises(TypeError, match="unsupported operand type"):
          df1.corrwith(df2, axis=1)
      result = df1.corrwith(df2, axis=1, numeric_only=True)
      expected = df1.loc[:, cols].corrwith(df2.loc[:, cols], axis=1)
      tm.assert_series_equal(result, expected)
  
imports: import numpy
  import pytest
  import pandas.util._test_decorators
  import pandas
  from pandas import DataFrame, Index, Series, date_range, isna
  import pandas._testing
label_desc: Use image node_id 2 for calling the TestDataFrameCorrWith obj's underlying member method code with example usage: obj.test_corrwith_with_objects(using_infer_string) without return types