code: def _build_date_trunc_expression(
      date_string: str, time_granularity: TimeGranularity
  ) -> SqlDateTruncExpression:
      cast_expr = SqlCastToTimestampExpression(
          SqlStringLiteralExpression(literal_value=date_string)
      )
      return SqlDateTruncExpression(
          time_granularity=time_granularity, arg=cast_expr
      )
  
file_path: metricflow/metricflow/test/sql_clients/test_date_time_operations.py
imports: from __future__ import annotations
  import logging
  from typing import Any
  import pandas
  import pytest
  from dbt_semantic_interfaces.type_enums.date_part import DatePart
  from metricflow.protocols.sql_client import SqlClient
  from metricflow.sql.sql_exprs import SqlCastToTimestampExpression, SqlDateTruncExpression, SqlExtractExpression, SqlStringLiteralExpression
  from metricflow.time.time_granularity import TimeGranularity
label_desc: Use image node_id 2 for calling a global function with example usage: _build_date_trunc_expression(date_string, time_granularity) and returns: SqlDateTruncExpression