class_docstr: MLMD mixins for testing ResolverOps and resolver functions.
class_docstr_tok: ["MLMD","mixins","for","testing","ResolverOps","and","resolver","functions","."]
docstr: Adds a single artifact to MLMD and returns the TFleX Artifact object.
code: def prepare_tfx_artifact(
      self,
      artifact: Any,  # If set to types.Artifact, pytype throws spurious errors.
      properties: Optional[Dict[str, Union[int, str]]] = None,
      custom_properties: Optional[Dict[str, Union[int, str]]] = None,
      state: metadata_store_pb2.Artifact.State = metadata_store_pb2.Artifact.State.LIVE,
  ) -> types.Artifact:
      """Adds a single artifact to MLMD and returns the TFleX Artifact object."""
      mlmd_artifact = self.put_artifact(
          artifact.TYPE_NAME,
          properties=properties,
          custom_properties=custom_properties,
          state=state,
      )
      artifact_type = self.store.get_artifact_type(artifact.TYPE_NAME)
      return artifact_utils.deserialize_artifact(
          artifact_type, mlmd_artifact
      )
  
imports: from typing import Type, Any, Dict, List, Optional, Sequence, Tuple, Union, Mapping
  from unittest import mock
  from absl.testing import parameterized
  from tfx import types
  from tfx.dsl.compiler import compiler_context
  from tfx.dsl.compiler import node_inputs_compiler
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.components.base import base_executor
  from tfx.dsl.components.base import executor_spec
  from tfx.dsl.input_resolution import resolver_op
  from tfx.dsl.input_resolution.ops import ops_utils
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact
  from tfx.types import artifact_utils
  from tfx.types import channel
  from tfx.types import component_spec
  from tfx.utils import test_case_utils
  from tfx.utils import typing_utils
  import ml_metadata
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling the ResolverTestCase obj's underlying member method code with example usage: obj.prepare_tfx_artifact(artifact, properties, custom_properties, state) and returns: artifact_utils