class_docstr: Abstract TFX executor class for Beam powered components.
class_docstr_tok: ["Abstract","TFX","executor","class","for","Beam","powered","components","."]
docstr: Makes beam pipeline.
docstr_tok: ["Makes","beam","pipeline","."]
code: def _make_beam_pipeline(self) -> _BeamPipeline:
      """Makes beam pipeline."""
      if self._make_beam_pipeline_fn is not None:
          return self._make_beam_pipeline_fn()
      if not beam:
          raise Exception(
              "Apache Beam must be installed to use this functionality."
          )
  
      result = beam.Pipeline(argv=self._beam_pipeline_args)
  
      # TODO(b/159468583): Obivate this code block by moving the warning to Beam.
      #
      # pylint: disable=g-import-not-at-top
      # pytype: disable=import-error
      from apache_beam.options.pipeline_options import DirectOptions
      from apache_beam.options.pipeline_options import PipelineOptions
  
      # pytype: enable=import-error
      options = PipelineOptions(self._beam_pipeline_args)
      direct_running_mode = options.view_as(
          DirectOptions
      ).direct_running_mode
      direct_num_workers = options.view_as(
          DirectOptions
      ).direct_num_workers
      if direct_running_mode == "in_memory" and direct_num_workers != 1:
          logging.warning(
              "If direct_num_workers is not equal to 1, direct_running_mode should "
              "be `multi_processing` or `multi_threading` instead of `in_memory` "
              "in order for it to have the desired worker parallelism effect."
          )
  
      return result
  
file_path: tfx/tfx/dsl/components/base/base_beam_executor.py
imports: import sys
  from typing import Any, Callable, List, Optional, Union
  from absl import flags
  from absl import logging
  from tfx.dsl.components.base.base_executor import BaseExecutor
  from tfx.dsl.placeholder import placeholder
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import name_utils
  from tfx.utils import telemetry_utils
  from tfx.utils import dependency_utils
label_desc: Use image node_id 2 for calling the BaseBeamExecutor obj's underlying member method code with example usage: obj._make_beam_pipeline() and returns: result, self