class_docstr: Wrap component as beam DoFn.
class_docstr_tok: ["Wrap","component","as","beam","DoFn","."]
docstr: Initialize the _ComponentAsDoFn.
  
  Args:
    component: Component that to be executed.
    component_launcher_class: The class of the launcher to launch the
      component.
    component_config: component config to launch the component.
    tfx_pipeline: Logical pipeline that contains pipeline related information.
docstr_tok: ["Initialize","the","_ComponentAsDoFn",".","Args",":","component",":","Component","that","to","be","executed",".","component_launcher_class",":","The","class","of","the","launcher","to","launch","the","component",".","component_config",":","component","config","to","launch","the","component",".","tfx_pipeline",":","Logical","pipeline","that","contains","pipeline","related","information","."]
code: def __init__(
      self,
      component: base_node.BaseNode,
      component_launcher_class: Type[
          base_component_launcher.BaseComponentLauncher
      ],
      component_config: base_component_config.BaseComponentConfig,
      tfx_pipeline: pipeline.Pipeline,
  ):
      """Initialize the _ComponentAsDoFn.
  
      Args:
        component: Component that to be executed.
        component_launcher_class: The class of the launcher to launch the
          component.
        component_config: component config to launch the component.
        tfx_pipeline: Logical pipeline that contains pipeline related information.
      """
      driver_args = data_types.DriverArgs(
          enable_cache=tfx_pipeline.enable_cache
      )
      metadata_connection = metadata.Metadata(
          tfx_pipeline.metadata_connection_config
      )
      self._component_launcher = component_launcher_class.create(
          component=component,
          pipeline_info=tfx_pipeline.pipeline_info,
          driver_args=driver_args,
          metadata_connection=metadata_connection,
          beam_pipeline_args=tfx_pipeline.beam_pipeline_args,
          additional_pipeline_args=tfx_pipeline.additional_pipeline_args,
          component_config=component_config,
      )
      self._component_id = component.id
  
imports: import datetime
  from typing import Any, Iterable, List, Optional, Type
  import absl
  import apache_beam
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_node
  from tfx.orchestration import data_types
  from tfx.orchestration import metadata
  from tfx.orchestration import pipeline
  from tfx.orchestration import tfx_runner
  from tfx.orchestration.config import base_component_config
  from tfx.orchestration.config import config_utils
  from tfx.orchestration.config import pipeline_config
  from tfx.orchestration.launcher import base_component_launcher
  from tfx.orchestration.launcher import docker_component_launcher
  from tfx.orchestration.launcher import in_process_component_launcher
  from tfx.utils import telemetry_utils
label_desc: Use image node_id 1 to create a new _ComponentAsDoFn object from inherited base classes: beam with example: obj = _ComponentAsDoFn(component, component_launcher_class, component_config, tfx_pipeline)