code: def convert_and_check(
      request: FixtureRequest,
      mf_test_session_state: MetricFlowTestSessionState,
      dataflow_to_sql_converter: DataflowToSqlQueryPlanConverter,
      sql_client: SqlClient,
      node: BaseOutput,
  ) -> None:
      """Convert the dataflow plan to SQL and compare with snapshots."""
      # Generate plans w/o optimizers
      sql_query_plan = (
          dataflow_to_sql_converter.convert_to_sql_query_plan(
              sql_engine_type=sql_client.sql_engine_type,
              sql_query_plan_id="plan0",
              dataflow_plan_node=node,
              optimization_level=SqlQueryOptimizationLevel.O0,
          )
      )
  
      display_graph_if_requested(
          request=request,
          mf_test_session_state=mf_test_session_state,
          dag_graph=sql_query_plan,
      )
  
      assert_sql_plan_text_equal(
          request=request,
          mf_test_session_state=mf_test_session_state,
          sql_query_plan=sql_query_plan,
      )
  
      assert_rendered_sql_from_plan_equal(
          request=request,
          mf_test_session_state=mf_test_session_state,
          sql_query_plan=sql_query_plan,
          sql_client=sql_client,
      )
  
      # Generate plans with optimizers
      sql_query_plan = (
          dataflow_to_sql_converter.convert_to_sql_query_plan(
              sql_engine_type=sql_client.sql_engine_type,
              sql_query_plan_id="plan0_optimized",
              dataflow_plan_node=node,
              optimization_level=SqlQueryOptimizationLevel.O4,
          )
      )
  
      display_graph_if_requested(
          request=request,
          mf_test_session_state=mf_test_session_state,
          dag_graph=sql_query_plan,
      )
  
      assert_rendered_sql_from_plan_equal(
          request=request,
          mf_test_session_state=mf_test_session_state,
          sql_query_plan=sql_query_plan,
          sql_client=sql_client,
      )
  
imports: from __future__ import annotations
  from typing import List
  import pytest
  from _pytest.fixtures import FixtureRequest
  from dbt_semantic_interfaces.implementations.metric import PydanticMetricTimeWindow
  from dbt_semantic_interfaces.references import EntityReference, TimeDimensionReference
  from dbt_semantic_interfaces.test_utils import as_datetime
  from dbt_semantic_interfaces.type_enums.aggregation_type import AggregationType
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder
  from metricflow.dataflow.dataflow_plan import AggregateMeasuresNode, BaseOutput, CombineAggregatedOutputsNode, ComputeMetricsNode, ConstrainTimeRangeNode, DataflowPlan, FilterElementsNode, JoinDescription, JoinToBaseOutputNode, JoinToTimeSpineNode, MetricTimeDimensionTransformNode, OrderByLimitNode, SemiAdditiveJoinNode, WhereConstraintNode, WriteToResultDataframeNode
  from metricflow.dataflow.dataflow_plan_to_text import dataflow_plan_as_text
  from metricflow.filters.time_constraint import TimeRangeConstraint
  from metricflow.plan_conversion.dataflow_to_sql import DataflowToSqlQueryPlanConverter
  from metricflow.protocols.sql_client import SqlClient
  from metricflow.query.query_parser import MetricFlowQueryParser
  from metricflow.specs.column_assoc import ColumnAssociationResolver
  from metricflow.specs.specs import DimensionSpec, InstanceSpecSet, LinkableSpecSet, LinklessEntitySpec, MeasureSpec, MetricFlowQuerySpec, MetricInputMeasureSpec, MetricSpec, NonAdditiveDimensionSpec, OrderBySpec, TimeDimensionSpec, WhereFilterSpec
  from metricflow.sql.optimizer.optimization_levels import SqlQueryOptimizationLevel
  from metricflow.sql.sql_bind_parameters import SqlBindParameters
  from metricflow.sql.sql_plan import SqlJoinType
  from metricflow.test.dataflow_plan_to_svg import display_graph_if_requested
  from metricflow.test.fixtures.model_fixtures import ConsistentIdObjectRepository
  from metricflow.test.fixtures.setup_fixtures import MetricFlowTestSessionState
  from metricflow.test.snapshot_utils import assert_plan_snapshot_text_equal
  from metricflow.test.sql.compare_sql_plan import assert_rendered_sql_from_plan_equal, assert_sql_plan_text_equal
  from metricflow.test.time.metric_time_dimension import MTD_SPEC_DAY
label_desc: Use image node_id 1 for calling a global function with example usage: convert_and_check(request, mf_test_session_state, dataflow_to_sql_converter, sql_client, node) without return types