class_docstr: Helper class for constructing various join components in a SqlQueryPlan.
docstr: Build join expression used to join a metric to a time spine dataset.
docstr_tok: ["Build","join","expression","used","to","join","a","metric","to","a","time","spine","dataset","."]
code: def make_join_to_time_spine_join_description(
      node: JoinToTimeSpineNode,
      time_spine_alias: str,
      metric_time_dimension_column_name: str,
      parent_sql_select_node: SqlSelectStatementNode,
      parent_alias: str,
  ) -> SqlJoinDescription:
      """Build join expression used to join a metric to a time spine dataset."""
      left_expr: SqlExpressionNode = SqlColumnReferenceExpression(
          col_ref=SqlColumnReference(
              table_alias=time_spine_alias,
              column_name=metric_time_dimension_column_name,
          )
      )
      if node.offset_window:
          left_expr = SqlSubtractTimeIntervalExpression(
              arg=left_expr,
              count=node.offset_window.count,
              granularity=node.offset_window.granularity,
          )
      elif node.offset_to_grain:
          left_expr = SqlDateTruncExpression(
              time_granularity=node.offset_to_grain, arg=left_expr
          )
  
      return SqlJoinDescription(
          right_source=parent_sql_select_node,
          right_source_alias=parent_alias,
          on_condition=SqlComparisonExpression(
              left_expr=left_expr,
              comparison=SqlComparison.EQUALS,
              right_expr=SqlColumnReferenceExpression(
                  col_ref=SqlColumnReference(
                      table_alias=parent_alias,
                      column_name=metric_time_dimension_column_name,
                  )
              ),
          ),
          join_type=node.join_type,
      )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import List, Optional, Sequence, Tuple
  from dbt_semantic_interfaces.protocols.metric import MetricTimeWindow
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from metricflow.assert_one_arg import assert_exactly_one_arg_set
  from metricflow.dataflow.dataflow_plan import JoinConversionEventsNode, JoinDescription, JoinOverTimeRangeNode, JoinToTimeSpineNode
  from metricflow.dataset.sql_dataset import SqlDataSet
  from metricflow.plan_conversion.sql_expression_builders import make_coalesced_expr
  from metricflow.sql.sql_exprs import SqlColumnReference, SqlColumnReferenceExpression, SqlComparison, SqlComparisonExpression, SqlDateTruncExpression, SqlIsNullExpression, SqlLogicalExpression, SqlLogicalOperator, SqlSubtractTimeIntervalExpression
  from metricflow.sql.sql_plan import SqlExpressionNode, SqlJoinDescription, SqlJoinType, SqlSelectStatementNode
label_desc: Use image node_id 10 for calling the SqlQueryPlanJoinBuilder obj's underlying member method code with example usage: obj.make_join_to_time_spine_join_description(node, time_spine_alias, metric_time_dimension_column_name, parent_sql_select_node, parent_alias) and returns: SqlJoinDescription