class_docstr: Engine spec for Google's BigQuery
  
  As contributed by @mxmzdlv on issue #945
class_docstr_tok: ["Engine","spec","for","Google","'s","BigQuery","As","contributed","by","@","mxmzdlv","on","issue","#","945"]
code: def extra_table_metadata(
      cls,
      database: "Database",
      table_name: str,
      schema_name: Optional[str],
  ) -> dict[str, Any]:
      indexes = database.get_indexes(table_name, schema_name)
      if not indexes:
          return {}
      partitions_columns = [
          index.get("column_names", [])
          for index in indexes
          if index.get("name") == "partition"
      ]
      cluster_columns = [
          index.get("column_names", [])
          for index in indexes
          if index.get("name") == "clustering"
      ]
      return {
          "partitions": {"cols": partitions_columns},
          "clustering": {"cols": cluster_columns},
      }
  
imports: import contextlib
  import json
  import re
  import urllib
  from datetime import datetime
  from re import Pattern
  from typing import Any, Optional, TYPE_CHECKING, TypedDict
  import pandas
  from apispec import APISpec
  from apispec.ext.marshmallow import MarshmallowPlugin
  from deprecation import deprecated
  from flask_babel import gettext
  from marshmallow import fields, Schema
  from marshmallow.exceptions import ValidationError
  from sqlalchemy import column, types
  from sqlalchemy.engine.base import Engine
  from sqlalchemy.engine.reflection import Inspector
  from sqlalchemy.sql import sqltypes
  from superset import sql_parse
  from superset.constants import PASSWORD_MASK, TimeGrain
  from superset.databases.schemas import encrypted_field_properties, EncryptedString
  from superset.databases.utils import make_url_safe
  from superset.db_engine_specs.base import BaseEngineSpec, BasicPropertiesType
  from superset.db_engine_specs.exceptions import SupersetDBAPIConnectionError
  from superset.errors import SupersetError, SupersetErrorType
  from superset.exceptions import SupersetException
  from superset.sql_parse import Table
  from superset.superset_typing import ResultSetColumnType
  from superset.utils import core
  from superset.utils.hashing import md5_sha_from_str
label_desc: Use image node_id 7 for calling the BigQueryEngineSpec obj's underlying member method code with example usage: obj.extra_table_metadata(cls, database, table_name, schema_name) and returns: dict, dict