code: def test_feature_processor_validation_fails(
      udf, udf_wrapper, validator_chain, fp_config
  ):
      with patch.object(
          FeatureProcessorConfig, "create", return_value=fp_config
      ) as fp_config_create_method:
          with patch.object(
              UDFWrapperFactory,
              "get_udf_wrapper",
              return_value=udf_wrapper,
          ) as get_udf_wrapper:
              with patch.object(
                  ValidatorFactory,
                  "get_validation_chain",
                  return_value=validator_chain,
              ) as get_validation_chain:
                  validator_chain.validate.side_effect = ValueError()
  
                  # Verify validation error is raised to user.
                  with pytest.raises(ValueError):
                      feature_processor(
                          inputs=tdh.FEATURE_PROCESSOR_INPUTS,
                          output=tdh.OUTPUT_FEATURE_GROUP_ARN,
                      )(udf)
  
                  # Verify validation failure causes execution to terminate early.
                  # Verify FeatureProcessorConfig interactions.
                  fp_config_create_method.assert_called()
                  get_udf_wrapper.assert_called_once()
                  get_validation_chain.assert_called_once()
                  validator_chain.validate.assert_called_with(
                      fp_config=fp_config, udf=udf
                  )
                  udf_wrapper.wrap.assert_not_called()
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/feature_store/feature_processor/test_feature_processor.py
imports: from __future__ import absolute_import
  from typing import Callable
  import pytest
  import test_data_helpers
  from mock import Mock, patch
  from sagemaker.feature_store.feature_processor._enums import FeatureProcessorMode
  from sagemaker.feature_store.feature_processor._factory import UDFWrapperFactory, ValidatorFactory
  from sagemaker.feature_store.feature_processor._feature_processor_config import FeatureProcessorConfig
  from sagemaker.feature_store.feature_processor._udf_wrapper import UDFWrapper
  from sagemaker.feature_store.feature_processor._validation import ValidatorChain
  from sagemaker.feature_store.feature_processor.feature_processor import feature_processor
label_desc: Use image node_id 7 for calling a global function with example usage: test_feature_processor_validation_fails(udf, udf_wrapper, validator_chain, fp_config) without return types