class_docstr: Pydantic class to help parse table snapshots that are defined in YAML.
docstr: Return this snapshot as represented by an equivalent dataframe.
docstr_tok: ["Return","this","snapshot","as","represented","by","an","equivalent","dataframe","."]
code: def as_df(self) -> pd.DataFrame:  # noqa: D
      """Return this snapshot as represented by an equivalent dataframe."""
      # In the YAML files, all values are strings, but they need to be converted to defined type so that it can be
      # properly represented in a dataframe
  
      type_converted_rows = []
      for row in self.rows:
          type_converted_row: List[
              Union[str, datetime.datetime, int, float, bool, None]
          ] = []
          for column_num, column_value in enumerate(row):
              column_type = self.column_definitions[column_num].type
              if column_value is None:
                  type_converted_row.append(None)
              elif column_type is SqlTableColumnType.STRING:
                  type_converted_row.append(column_value)
              elif column_type is SqlTableColumnType.TIME:
                  type_converted_row.append(
                      dateutil.parser.parse(column_value)
                  )
              elif column_type is SqlTableColumnType.INT:
                  type_converted_row.append(int(column_value))
              elif column_type is SqlTableColumnType.FLOAT:
                  type_converted_row.append(float(column_value))
              elif column_type is SqlTableColumnType.BOOLEAN:
                  type_converted_row.append(
                      SqlTableSnapshot._parse_bool_str(column_value)
                  )
              else:
                  assert_values_exhausted(column_type)
          type_converted_rows.append(type_converted_row)
  
      return pd.DataFrame(
          columns=[
              column_definition.name
              for column_definition in self.column_definitions
          ],
          data=type_converted_rows,
      )
  
imports: from __future__ import annotations
  import datetime
  import logging
  import os
  from collections import OrderedDict
  from dataclasses import dataclass
  from enum import Enum
  from pathlib import Path
  from typing import List, Optional, Sequence, Tuple, Union
  import dateutil.parser
  import pandas
  import yaml
  from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
  from dbt_semantic_interfaces.implementations.base import FrozenBaseModel
  from metricflow.dataflow.sql_table import SqlTable
  from metricflow.specs.specs import hash_items
  from metricflow.test.fixtures.sql_clients.ddl_sql_client import SqlClientWithDDLMethods
label_desc: Use image node_id 3 for calling the SqlTableSnapshot obj's underlying member method code with example usage: obj.as_df() and returns: pd