class_docstr: A specification for a component executor.
  
  An instance of ExecutorSpec describes the implementation of a component.
class_docstr_tok: ["A","specification","for","a","component","executor",".","An","instance","of","ExecutorSpec","describes","the","implementation","of","a","component","."]
docstr: Encodes ExecutorSpec into an IR proto for compiling.
  
  This method will be used by DSL compiler to generate the corresponding IR.
  
  Args:
    component_spec: Optional. The ComponentSpec to help with the encoding.
  
  Returns:
    An executor spec proto.
docstr_tok: ["Encodes","ExecutorSpec","into","an","IR","proto","for","compiling",".","This","method","will","be","used","by","DSL","compiler","to","generate","the","corresponding","IR",".","Args",":","component_spec",":","Optional",".","The","ComponentSpec","to","help","with","the","encoding",".","Returns",":","An","executor","spec","proto","."]
code: def encode(
      self, component_spec: Optional[types.ComponentSpec] = None
  ) -> message.Message:
      """Encodes ExecutorSpec into an IR proto for compiling.
  
      This method will be used by DSL compiler to generate the corresponding IR.
  
      Args:
        component_spec: Optional. The ComponentSpec to help with the encoding.
  
      Returns:
        An executor spec proto.
      """
      # TODO(b/158712976, b/161286496): Serialize executor specs for different
      # platforms.
      raise NotImplementedError(
          "{} does not support encoding into IR.".format(
              name_utils.get_full_name(self.__class__)
          )
      )
  
imports: import copy
  from typing import cast, Iterable, List, Optional, Type, Union
  from tfx import types
  from tfx.dsl.components.base import base_executor
  from tfx.dsl.placeholder import placeholder
  from tfx.proto.orchestration import executable_spec_pb2
  from tfx.proto.orchestration import placeholder_pb2
  from tfx.utils import import_utils
  from tfx.utils import json_utils
  from tfx.utils import name_utils
  from google.protobuf import message
label_desc: Use image node_id 1 for calling the ExecutorSpec obj's underlying member method code with example usage: obj.encode(component_spec) without return types