code: def test_nlargest_error(
      self, df_main_dtypes, nselect_method, columns
  ):
      df = df_main_dtypes
      col = columns[1]
      error_msg = (
          f"Column '{col}' has dtype {df[col].dtype}, "
          f"cannot use method '{nselect_method}' with this dtype"
      )
      # escape some characters that may be in the repr
      error_msg = (
          error_msg.replace("(", "\\(")
          .replace(")", "\\)")
          .replace("[", "\\[")
          .replace("]", "\\]")
      )
      with pytest.raises(TypeError, match=error_msg):
          getattr(df, nselect_method)(2, columns)
  
file_path: pandas/pandas/tests/frame/methods/test_nlargest.py
imports: from string import ascii_lowercase
  import numpy
  import pytest
  import pandas
  import pandas._testing
  from pandas.util.version import Version
label_desc: Use image node_id 2 for calling the TestNLargestNSmallest obj's underlying member method code with example usage: obj.test_nlargest_error(df_main_dtypes, nselect_method, columns) without return types