class_docstr: Base class for a TFX pipeline component.
  
  An instance of a subclass of BaseComponent represents the parameters for a
  single execution of that TFX pipeline component.
  
  All subclasses of BaseComponent must override the SPEC_CLASS field with the
  ComponentSpec subclass that defines the interface of this component.
  
  Attributes:
    SPEC_CLASS: a subclass of types.ComponentSpec used by this component
      (required). This is a class level value.
    EXECUTOR_SPEC: an instance of executor_spec.ExecutorSpec which describes how
      to execute this component (required). This is a class level value.
    DRIVER_CLASS: a subclass of base_driver.BaseDriver as a custom driver for
      this component (optional, defaults to base_driver.BaseDriver). This is a
      class level value.
    PRE_EXECUTABLE_SPEC: an optional PythonClassExecutableSpec of pre-execution
      hook.
    POST_EXECUTABLE_SPEC an optional PythonClassExecutableSpec of post-execution
      hook.
    spec: an instance of `SPEC_CLASS`. See types.ComponentSpec for more details.
    platform_config: a protobuf message representing platform config for a
      component instance.
class_docstr_tok: ["Base","class","for","a","TFX","pipeline","component",".","An","instance","of","a","subclass","of","BaseComponent","represents","the","parameters","for","a","single","execution","of","that","TFX","pipeline","component",".","All","subclasses","of","BaseComponent","must","override","the","SPEC_CLASS","field","with","the","ComponentSpec","subclass","that","defines","the","interface","of","this","component",".","Attributes",":","SPEC_CLASS",":","a","subclass","of","types.ComponentSpec","used","by","this","component","(","required",")",".","This","is","a","class","level","value",".","EXECUTOR_SPEC",":","an","instance","of","executor_spec.ExecutorSpec","which","describes","how","to","execute","this","component","(","required",")",".","This","is","a","class","level","value",".","DRIVER_CLASS",":","a","subclass","of","base_driver.BaseDriver","as","a","custom","driver","for","this","component","(","optional",",","defaults","to","base_driver.BaseDriver",")",".","This","is","a","class","level","value",".","PRE_EXECUTABLE_SPEC",":","an","optional","PythonClassExecutableSpec","of","pre-execution","hook",".","POST_EXECUTABLE_SPEC","an","optional","PythonClassExecutableSpec","of","post-execution","hook",".","spec",":","an","instance","of","`","SPEC_CLASS","`",".","See","types.ComponentSpec","for","more","details",".","platform_config",":","a","protobuf","message","representing","platform","config","for","a","component","instance","."]
docstr: Initialize a component.
  
  Args:
    spec: types.ComponentSpec object for this component instance.
    custom_executor_spec: Optional custom executor spec overriding the default
      executor specified in the component attribute.
docstr_tok: ["Initialize","a","component",".","Args",":","spec",":","types.ComponentSpec","object","for","this","component","instance",".","custom_executor_spec",":","Optional","custom","executor","spec","overriding","the","default","executor","specified","in","the","component","attribute","."]
code: def __init__(
      self,
      spec: types.ComponentSpec,
      custom_executor_spec: Optional[executor_spec.ExecutorSpec] = None,
  ):
      """Initialize a component.
  
      Args:
        spec: types.ComponentSpec object for this component instance.
        custom_executor_spec: Optional custom executor spec overriding the default
          executor specified in the component attribute.
      """
      if custom_executor_spec:
          if not isinstance(
              custom_executor_spec, executor_spec.ExecutorSpec
          ):
              raise TypeError(
                  (
                      "Custom executor spec override %s for %s should be an instance of "
                      "ExecutorSpec"
                  )
                  % (custom_executor_spec, self.__class__)
              )
  
      executor_spec_obj = (
          custom_executor_spec or self.__class__.EXECUTOR_SPEC
      )
      # TODO(b/171742415): Remove this try-catch block once we migrate Beam
      # DAG runner to IR-based stack. The deep copy will only fail for function
      # based components due to pickle workaround we created in ExecutorClassSpec.
      try:
          executor_spec_obj = executor_spec_obj.copy()
      except Exception as e:  # pylint:disable = bare-except
          # This will only happen for function based components, which is fine.
          raise ValueError(
              f"The executor spec {executor_spec_obj!r} of {self.__class__} class "
              "is not copyable."
          ) from e
  
      driver_class = self.__class__.DRIVER_CLASS
      # Set self.spec before super.__init__() where node registration happens.
      # This enable node input checking on node context registration.
      self._validate_spec(spec)
      spec.migrate_output_channels(self)
      self.spec = spec
      super().__init__(
          executor_spec=executor_spec_obj,
          driver_class=driver_class,
      )
      self._validate_component_class()
      self.platform_config = None
      self._pip_dependencies = []
  
imports: import abc
  import inspect
  from typing import Any, Dict, Optional, Type, Union
  from tfx import types
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.components.base import base_node
  from tfx.dsl.components.base import executor_spec
  from tfx.types import channel
  from tfx.types.system_executions import SystemExecution
  from tfx.utils import abc_utils
  from tfx.utils import doc_controls
  from google.protobuf import message
label_desc: Use image node_id 1 to create a new BaseComponent object from inherited base classes: base_node, abc with example: obj = BaseComponent(spec, custom_executor_spec)