class_docstr: Converts a dataflow plan to an execution plan.
class_docstr_tok: ["Converts","a","dataflow","plan","to","an","execution","plan","."]
code: def _build_execution_plan(  # noqa: D
      self,
      node: Union[BaseOutput, ComputedMetricsOutput],
      output_table: Optional[SqlTable] = None,
  ) -> ExecutionPlan:
      sql_plan = self._sql_plan_converter.convert_to_sql_query_plan(
          sql_engine_type=self._sql_client.sql_engine_type,
          sql_query_plan_id=IdGeneratorRegistry.for_class(
              SqlQueryPlan
          ).create_id(SQL_QUERY_PLAN_PREFIX),
          dataflow_plan_node=node,
      )
  
      logger.debug(
          f"Generated SQL query plan is:\n{sql_query_plan_as_text(sql_plan)}"
      )
  
      render_result = self._sql_plan_renderer.render_sql_query_plan(
          sql_plan
      )
  
      leaf_task: ExecutionPlanTask
  
      if not output_table:
          leaf_task = SelectSqlQueryToDataFrameTask(
              sql_client=self._sql_client,
              sql_query=render_result.sql,
              bind_parameters=render_result.bind_parameters,
              extra_sql_tags=self._sql_tags,
          )
      else:
          leaf_task = SelectSqlQueryToTableTask(
              sql_client=self._sql_client,
              sql_query=render_result.sql,
              bind_parameters=render_result.bind_parameters,
              output_table=output_table,
              extra_sql_tags=self._sql_tags,
          )
  
      return ExecutionPlan(
          plan_id=IdGeneratorRegistry.for_class(
              self.__class__
          ).create_id(EXEC_PLAN_PREFIX),
          leaf_tasks=[leaf_task],
      )
  
file_path: metricflow/metricflow/plan_conversion/dataflow_to_execution.py
imports: from __future__ import annotations
  import logging
  from typing import Optional, Union
  from metricflow.dag.id_generation import EXEC_PLAN_PREFIX, SQL_QUERY_PLAN_PREFIX, IdGeneratorRegistry
  from metricflow.dataflow.dataflow_plan import BaseOutput, ComputedMetricsOutput, DataflowPlan, SinkNodeVisitor, WriteToResultDataframeNode, WriteToResultTableNode
  from metricflow.dataflow.sql_table import SqlTable
  from metricflow.execution.execution_plan import ExecutionPlan, ExecutionPlanTask, SelectSqlQueryToDataFrameTask, SelectSqlQueryToTableTask
  from metricflow.plan_conversion.dataflow_to_sql import DataflowToSqlQueryPlanConverter
  from metricflow.protocols.sql_client import SqlClient
  from metricflow.sql.render.sql_plan_renderer import SqlQueryPlanRenderer
  from metricflow.sql.sql_plan import SqlQueryPlan
  from metricflow.sql.sql_plan_to_text import sql_query_plan_as_text
  from metricflow.sql_request.sql_request_attributes import SqlJsonTag
label_desc: Use image node_id 2 for calling the DataflowToExecutionPlanConverter obj's underlying member method code with example usage: obj._build_execution_plan(node, output_table) and returns: ExecutionPlan