code: def test_to_numeric(self):
      pser = pd.Series(["1", "2", None, "4", "hello"])
      psser = ps.from_pandas(pser)
  
      # "coerce" and "raise" with Series that contains un-parsable data.
      self.assert_eq(
          pd.to_numeric(pser, errors="coerce"),
          ps.to_numeric(psser, errors="coerce"),
          almost=True,
      )
  
      # "raise" with Series that contains parsable data only.
      pser = pd.Series(["1", "2", None, "4", "5.0"])
      psser = ps.from_pandas(pser)
  
      self.assert_eq(
          pd.to_numeric(pser, errors="raise"),
          ps.to_numeric(psser, errors="raise"),
          almost=True,
      )
  
      # "coerce", "ignore" and "raise" with non-Series.
      data = ["1", "2", None, "4", "hello"]
      self.assert_eq(
          pd.to_numeric(data, errors="coerce"),
          ps.to_numeric(data, errors="coerce"),
      )
      self.assert_eq(
          pd.to_numeric(data, errors="ignore"),
          ps.to_numeric(data, errors="ignore"),
      )
  
      self.assertRaisesRegex(
          ValueError,
          'Unable to parse string "hello"',
          lambda: ps.to_numeric(data, errors="raise"),
      )
  
      # "raise" with non-Series that contains parsable data only.
      data = ["1", "2", None, "4", "5.0"]
  
      self.assert_eq(
          pd.to_numeric(data, errors="raise"),
          ps.to_numeric(data, errors="raise"),
          almost=True,
      )
  
      # Wrong string for `errors` parameter.
      self.assertRaisesRegex(
          ValueError,
          "invalid error value specified",
          lambda: ps.to_numeric(psser, errors="errors"),
      )
      # NotImplementedError
      self.assertRaisesRegex(
          NotImplementedError,
          "'ignore' is not implemented yet, when the `arg` is Series.",
          lambda: ps.to_numeric(psser, errors="ignore"),
      )
  
imports: import itertools
  import inspect
  import pandas
  import numpy
  from pyspark import pandas
  from pyspark.pandas.exceptions import PandasNotImplementedError
  from pyspark.pandas.namespace import _get_index_map, read_delta
  from pyspark.pandas.utils import spark_column_equals
  from pyspark.pandas.missing.general_functions import MissingPandasLikeGeneralFunctions
  from pyspark.testing.pandasutils import PandasOnSparkTestCase
  from pyspark.testing.sqlutils import SQLTestUtils
label_desc: Use image node_id 12 for calling the NamespaceTestsMixin obj's underlying member method code with example usage: obj.test_to_numeric() without return types