docs: def from_bigquery(sql):
      """Create a Metrics instance from a bigquery query or table.
  
      Returns:
        a Metrics instance.
  
      Args:
        sql: A BigQuery table name or a query.
      """
  
      if isinstance(sql, bq.Query):
        sql = sql._expanded_sql()
  
      parts = sql.split('.')
      if len(parts) == 1 or len(parts) > 3 or any(' ' in x for x in parts):
        sql = '(' + sql + ')'  # query, not a table name
      else:
        sql = '`' + sql + '`'  # table name
  
      metrics = Metrics(bigquery=sql)
      return metrics