code: def test_spark_udf_signature_validator_udf_invalid_non_input_position():
      fp_config = tdh.create_fp_config(
          inputs=[tdh.FEATURE_GROUP_DATA_SOURCE, tdh.S3_DATA_SOURCE]
      )
      with pytest.raises(
          ValueError,
          match="feature_processor expected the 'params' parameter to be the last or second last"
          " parameter after input parameters.",
      ):
  
          def invalid_params_position(
              params, fg_data_source, s3_data_source
          ):
              return None
  
          SparkUDFSignatureValidator().validate(
              invalid_params_position, fp_config
          )
  
      with pytest.raises(
          ValueError,
          match="feature_processor expected the 'spark' parameter to be the last or second last"
          " parameter after input parameters.",
      ):
  
          def invalid_spark_position(
              spark, fg_data_source, s3_data_source
          ):
              return None
  
          SparkUDFSignatureValidator().validate(
              invalid_spark_position, fp_config
          )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/feature_store/feature_processor/test_validation.py
imports: from __future__ import absolute_import
  from typing import Callable
  from pyspark.sql import DataFrame
  import pytest
  import test_data_helpers
  import string
  import random
  from mock import Mock
  from sagemaker.feature_store.feature_processor._validation import SparkUDFSignatureValidator, Validator, ValidatorChain, BaseDataSourceValidator
  from sagemaker.feature_store.feature_processor._data_source import BaseDataSource
label_desc: Use image node_id 6 for calling a global function with example usage: test_spark_udf_signature_validator_udf_invalid_non_input_position() and returns: None, None