class_docstr: Engine for Google spreadsheets
class_docstr_tok: ["Engine","for","Google","spreadsheets"]
code: def extra_table_metadata(
      cls,
      database: Database,
      table_name: str,
      schema_name: str | None,
  ) -> dict[str, Any]:
      with database.get_raw_connection(schema=schema_name) as conn:
          cursor = conn.cursor()
          cursor.execute(f'SELECT GET_METADATA("{table_name}")')
          results = cursor.fetchone()[0]
      try:
          metadata = json.loads(results)
      except Exception:  # pylint: disable=broad-except
          metadata = {}
  
      return {"metadata": metadata["extra"]}
  
imports: from __future__ import annotations
  import contextlib
  import json
  import logging
  import re
  from re import Pattern
  from typing import Any, TYPE_CHECKING, TypedDict
  import pandas
  from apispec import APISpec
  from apispec.ext.marshmallow import MarshmallowPlugin
  from flask import g
  from flask_babel import gettext
  from marshmallow import fields, Schema
  from marshmallow.exceptions import ValidationError
  from requests import Session
  from sqlalchemy.engine import create_engine
  from sqlalchemy.engine.url import URL
  from superset import db, security_manager
  from superset.constants import PASSWORD_MASK
  from superset.databases.schemas import encrypted_field_properties, EncryptedString
  from superset.db_engine_specs.shillelagh import ShillelaghEngineSpec
  from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
  from superset.exceptions import SupersetException
label_desc: Use image node_id 2 for calling the GSheetsEngineSpec obj's underlying member method code with example usage: obj.extra_table_metadata(cls, database, table_name, schema_name) and returns: dict