docstr: With cache enabled, if cached output artifacts are found but are missing, execution decision is to not use cache.
docstr_tok: ["With","cache","enabled",",","if","cached","output","artifacts","are","found","but","are","missing",",","execution","decision","is","to","not","use","cache","."]
code: def testPreExecutionCachedMissing(
      self, _, mock_artifact_utils_verify_artifacts_fn
  ):
      """With cache enabled, if cached output artifacts are found but are missing, execution decision is to not use cache."""
  
      # mock such that the output artifacts as pulled from cache are not present
      mock_artifact_utils_verify_artifacts_fn.side_effect = (
          RuntimeError()
      )
  
      self._mock_metadata.search_artifacts.return_value = list(
          self._input_dict["input_string"].get()
      )
      self._mock_metadata.register_run_context_if_not_exists.side_effect = [
          metadata_store_pb2.Context()
      ]
      self._mock_metadata.register_execution.side_effect = [
          self._execution
      ]
      self._mock_metadata.get_cached_outputs.side_effect = [
          self._output_artifacts
      ]
  
      driver = base_driver.BaseDriver(
          metadata_handle=self._mock_metadata
      )
      execution_decision = driver.pre_execution(
          input_dict=self._input_dict,
          output_dict=self._output_dict,
          exec_properties=self._exec_properties,
          driver_args=self._driver_args,
          pipeline_info=self._pipeline_info,
          component_info=self._component_info,
      )
  
      self.assertFalse(execution_decision.use_cached_results)
      self.assertEqual(
          execution_decision.execution_id, self._execution_id
      )
      self.assertCountEqual(
          execution_decision.exec_properties, self._exec_properties
      )
      self.assertCountEqual(
          execution_decision.output_dict, self._output_artifacts
      )
  
imports: import os
  from unittest import mock
  import tensorflow
  from tfx import types
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.io import fileio
  from tfx.orchestration import data_types
  from tfx.types import channel
  from tfx.types import channel_utils
  from tfx.types import standard_artifacts
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 5 for calling the BaseDriverTest obj's underlying member method code with example usage: obj.testPreExecutionCachedMissing(_, mock_artifact_utils_verify_artifacts_fn) without return types