class_docstr: A validator for PySpark UDF signatures.
docstr: Validate the signature of the UDF based on the configurations provided to the decorator.
  
  Args:
      udf (Callable[..., T]): The feature_processor wrapped user function.
      fp_config (FeatureProcessorConfig): The configuration for the feature_processor.
  
  Raises (ValueError): raises ValueError when any of the following scenario happen:
     1. No input provided to feature_processor.
     2. Number of provided parameters does not match with that of provided inputs.
     3. Required parameters are not provided in the right order.
docstr_tok: ["Validate","the","signature","of","the","UDF","based","on","the","configurations","provided","to","the","decorator",".","Args",":","udf","(","Callable","[","...",",","T","]",")",":","The","feature_processor","wrapped","user","function",".","fp_config","(","FeatureProcessorConfig",")",":","The","configuration","for","the","feature_processor",".","Raises","(","ValueError",")",":","raises","ValueError","when","any","of","the","following","scenario","happen",":","1",".","No","input","provided","to","feature_processor",".","2",".","Number","of","provided","parameters","does","not","match","with","that","of","provided","inputs",".","3",".","Required","parameters","are","not","provided","in","the","right","order","."]
code: def validate(
      self, udf: Callable[..., Any], fp_config: FeatureProcessorConfig
  ) -> None:
      """Validate the signature of the UDF based on the configurations provided to the decorator.
  
      Args:
          udf (Callable[..., T]): The feature_processor wrapped user function.
          fp_config (FeatureProcessorConfig): The configuration for the feature_processor.
  
      Raises (ValueError): raises ValueError when any of the following scenario happen:
         1. No input provided to feature_processor.
         2. Number of provided parameters does not match with that of provided inputs.
         3. Required parameters are not provided in the right order.
      """
      parameters = list(inspect.signature(udf).parameters.keys())
      input_parameters = self._get_input_params(udf)
      if len(input_parameters) < 1:
          raise ValueError(
              "feature_processor expects at least 1 input parameter."
          )
  
      # Validate count of input parameters against requested inputs.
      num_data_sources = len(fp_config.inputs)
      if len(input_parameters) != num_data_sources:
          raise ValueError(
              f"feature_processor expected a function with ({num_data_sources}) parameter(s)"
              f" before any optional 'params' or 'spark' parameters for the ({num_data_sources})"
              f" requested data source(s)."
          )
  
      # Validate position of non-input parameters.
      if (
          "params" in parameters
          and parameters[-1] != "params"
          and parameters[-2] != "params"
      ):
          raise ValueError(
              "feature_processor expected the 'params' parameter to be the last or second last"
              " parameter after input parameters."
          )
  
      if (
          "spark" in parameters
          and parameters[-1] != "spark"
          and parameters[-2] != "spark"
      ):
          raise ValueError(
              "feature_processor expected the 'spark' parameter to be the last or second last"
              " parameter after input parameters."
          )
  
imports: from __future__ import absolute_import
  import inspect
  import re
  from abc import ABC, abstractmethod
  from typing import Any, Callable, List
  import attr
  from sagemaker.feature_store.feature_processor._data_source import FeatureGroupDataSource, BaseDataSource
  from sagemaker.feature_store.feature_processor._feature_processor_config import FeatureProcessorConfig
  from sagemaker.feature_store.feature_processor._input_offset_parser import InputOffsetParser
label_desc: Use image node_id 1 for calling the SparkUDFSignatureValidator obj's underlying member method code with example usage: obj.validate(udf, fp_config) without return types