code: def _extract_dataframe_value(df: pd.DataFrame) -> Any:  # type: ignore[misc]
      """Helper to assert that a query result has a single value, and return the value from the dataframe."""
      assert df.shape == (
          1,
          1,
      ), f"Invalid dataframe, expected exactly one Timestamp value but got {df.to_markdown(index=False)}!"
      for col in df.select_dtypes(["datetimetz"]):
          # Remove time zone information if the engine includes it by default, because weird stuff happens there.
          df[col] = df[col].dt.tz_localize(None)
      return df.iloc[0, 0]
  
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 1 for calling a global function with example usage: _extract_dataframe_value(df) and returns: df