code: def _test_numeric_astype(self, pser):
      psser = ps.Series(pser)
  
      self.assert_eq(psser.astype(int), pser.astype(int))
      self.assert_eq(psser.astype(np.int8), pser.astype(np.int8))
      self.assert_eq(psser.astype(np.int16), pser.astype(np.int16))
      self.assert_eq(psser.astype(np.int32), pser.astype(np.int32))
      self.assert_eq(psser.astype(np.int64), pser.astype(np.int64))
      self.assert_eq(psser.astype(np.byte), pser.astype(np.byte))
      self.assert_eq(psser.astype("int"), pser.astype("int"))
      self.assert_eq(psser.astype("int8"), pser.astype("int8"))
      self.assert_eq(psser.astype("int16"), pser.astype("int16"))
      self.assert_eq(psser.astype("int32"), pser.astype("int32"))
      self.assert_eq(psser.astype("int64"), pser.astype("int64"))
      self.assert_eq(psser.astype("b"), pser.astype("b"))
      self.assert_eq(psser.astype("byte"), pser.astype("byte"))
      self.assert_eq(psser.astype("i"), pser.astype("i"))
      self.assert_eq(psser.astype("long"), pser.astype("long"))
      self.assert_eq(psser.astype("short"), pser.astype("short"))
      self.assert_eq(psser.astype(np.float32), pser.astype(np.float32))
      self.assert_eq(psser.astype(np.float64), pser.astype(np.float64))
      self.assert_eq(psser.astype("float"), pser.astype("float"))
      self.assert_eq(psser.astype("float32"), pser.astype("float32"))
      self.assert_eq(psser.astype("float64"), pser.astype("float64"))
      self.assert_eq(psser.astype("double"), pser.astype("double"))
      self.assert_eq(psser.astype("f"), pser.astype("f"))
      self.assert_eq(psser.astype(bool), pser.astype(bool))
      self.assert_eq(psser.astype("bool"), pser.astype("bool"))
      self.assert_eq(psser.astype("?"), pser.astype("?"))
      self.assert_eq(
          psser.astype(np.unicode_), pser.astype(np.unicode_)
      )
      self.assert_eq(psser.astype("str"), pser.astype("str"))
      self.assert_eq(psser.astype("U"), pser.astype("U"))
  
      if extension_dtypes_available:
          from pandas import (
              Int8Dtype,
              Int16Dtype,
              Int32Dtype,
              Int64Dtype,
          )
  
          self._check_extension(
              psser.astype("Int8"), pser.astype("Int8")
          )
          self._check_extension(
              psser.astype("Int16"), pser.astype("Int16")
          )
          self._check_extension(
              psser.astype("Int32"), pser.astype("Int32")
          )
          self._check_extension(
              psser.astype("Int64"), pser.astype("Int64")
          )
          self._check_extension(
              psser.astype(Int8Dtype()), pser.astype(Int8Dtype())
          )
          self._check_extension(
              psser.astype(Int16Dtype()), pser.astype(Int16Dtype())
          )
          self._check_extension(
              psser.astype(Int32Dtype()), pser.astype(Int32Dtype())
          )
          self._check_extension(
              psser.astype(Int64Dtype()), pser.astype(Int64Dtype())
          )
  
      if extension_object_dtypes_available:
          from pandas import StringDtype
  
          self._check_extension(
              psser.astype("string"), pser.astype("string")
          )
          self._check_extension(
              psser.astype(StringDtype()), pser.astype(StringDtype())
          )
  
      if extension_float_dtypes_available:
          from pandas import Float32Dtype, Float64Dtype
  
          self._check_extension(
              psser.astype("Float32"), pser.astype("Float32")
          )
          self._check_extension(
              psser.astype("Float64"), pser.astype("Float64")
          )
          self._check_extension(
              psser.astype(Float32Dtype()), pser.astype(Float32Dtype())
          )
          self._check_extension(
              psser.astype(Float64Dtype()), pser.astype(Float64Dtype())
          )
  
file_path: spark/python/pyspark/pandas/tests/series/test_as_type.py
imports: import unittest
  import numpy
  import pandas
  from pyspark import pandas
  from pyspark.testing.pandasutils import ComparisonTestBase
  from pyspark.testing.sqlutils import SQLTestUtils
  from pyspark.pandas.typedef.typehints import extension_dtypes_available, extension_float_dtypes_available, extension_object_dtypes_available
label_desc: Use image node_id 2 for calling the SeriesAsTypeMixin obj's underlying member method code with example usage: obj._test_numeric_astype(pser) without return types