code: def test_date_part_year(sql_client: SqlClient) -> None:
      """Tests date_part or extract behavior for year.
  
      This is necessary because ISOYEAR semantics might return the subsequent (or preceding) year depending
      on the date instead of the calendar year.
      """
      # The ISO year start for 2015 is 2014-12-29, so this should return 2015 for ISOYEAR
      ISO_DATE_STRING = "2014-12-30"
      # We, however, expect the calendar year
      expected = 2014
      extract_stmt = sql_client.sql_query_plan_renderer.expr_renderer.render_sql_expr(
          _build_extract_expression(
              date_string=ISO_DATE_STRING, date_part=DatePart.YEAR
          )
      ).sql
  
      df = sql_client.query(f"SELECT {extract_stmt}")
  
      actual = _extract_dataframe_value(df=df)
      assert expected == actual
  
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 7 for calling a global function with example usage: test_date_part_year(sql_client) without return types