code: def test_semi_additive_join_node_with_queried_group_by(
      request: FixtureRequest,
      mf_test_session_state: MetricFlowTestSessionState,
      consistent_id_object_repository: ConsistentIdObjectRepository,
      dataflow_to_sql_converter: DataflowToSqlQueryPlanConverter,
      sql_client: SqlClient,
  ) -> None:
      """Tests converting a dataflow plan to a SQL query plan using a SemiAdditiveJoinNode."""
      non_additive_dimension_spec = NonAdditiveDimensionSpec(
          name="ds", window_choice=AggregationType.MIN
      )
      time_dimension_spec = TimeDimensionSpec(
          element_name="ds", entity_links=()
      )
      queried_time_dimension_spec = TimeDimensionSpec(
          element_name="ds",
          entity_links=(),
          time_granularity=TimeGranularity.WEEK,
      )
  
      measure_source_node = (
          consistent_id_object_repository.simple_model_read_nodes[
              "accounts_source"
          ]
      )
      semi_additive_join_node = SemiAdditiveJoinNode(
          parent_node=measure_source_node,
          entity_specs=tuple(),
          time_dimension_spec=time_dimension_spec,
          agg_by_function=non_additive_dimension_spec.window_choice,
          queried_time_dimension_spec=queried_time_dimension_spec,
      )
      convert_and_check(
          request=request,
          mf_test_session_state=mf_test_session_state,
          dataflow_to_sql_converter=dataflow_to_sql_converter,
          sql_client=sql_client,
          node=semi_additive_join_node,
      )
  
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 16 for calling a global function with example usage: test_semi_additive_join_node_with_queried_group_by(request, mf_test_session_state, consistent_id_object_repository, dataflow_to_sql_converter, sql_client) without return types