code: def check_udf_wrong_arg(self):
      with self.assertRaises(PySparkTypeError) as pe:
  
          @pandas_udf(functionType=PandasUDFType.SCALAR)
          def foo(x):
              return x
  
      self.check_error(
          exception=pe.exception,
          error_class="CANNOT_BE_NONE",
          message_parameters={"arg_name": "returnType"},
      )
  
      with self.assertRaises(PySparkTypeError) as pe:
  
          @pandas_udf("double", 100)
          def foo(x):
              return x
  
      self.check_error(
          exception=pe.exception,
          error_class="INVALID_PANDAS_UDF_TYPE",
          message_parameters={
              "arg_name": "functionType",
              "arg_type": "100",
          },
      )
  
      with self.assertRaisesRegex(
          ValueError, "0-arg pandas_udfs.*not.*supported"
      ):
          pandas_udf(lambda: 1, LongType(), PandasUDFType.SCALAR)
      with self.assertRaisesRegex(
          ValueError, "0-arg pandas_udfs.*not.*supported"
      ):
  
          @pandas_udf(LongType(), PandasUDFType.SCALAR)
          def zero_with_type():
              return 1
  
      with self.assertRaises(PySparkTypeError) as pe:
  
          @pandas_udf(returnType=PandasUDFType.GROUPED_MAP)
          def foo(df):
              return df
  
      self.check_error(
          exception=pe.exception,
          error_class="NOT_DATATYPE_OR_STR",
          message_parameters={
              "arg_name": "returnType",
              "arg_type": "int",
          },
      )
  
imports: import unittest
  import datetime
  from typing import cast
  from pyspark.sql.functions import udf, pandas_udf, PandasUDFType, assert_true, lit
  from pyspark.sql.types import DoubleType, StructType, StructField, LongType, DayTimeIntervalType
  from pyspark.errors import ParseException, PythonException, PySparkTypeError
  from pyspark.rdd import PythonEvalType
  from pyspark.testing.sqlutils import ReusedSQLTestCase, have_pandas, have_pyarrow, pandas_requirement_message, pyarrow_requirement_message
  from pyspark.testing.utils import QuietTest
label_desc: Use image node_id 6 for calling the PandasUDFTestsMixin obj's underlying member method code with example usage: obj.check_udf_wrong_arg() and returns: x, x, int, df