class_docstr: Interact with Trino through trino package.
  
  >>> ph = TrinoHook()
  >>> sql = "SELECT count(1) AS num FROM airflow.static_babynames"
  >>> ph.get_records(sql)
  [[340698]]
class_docstr_tok: ["Interact","with","Trino","through","trino","package",".",">",">",">","ph","=","TrinoHook","(",")",">",">",">","sql","=","``","SELECT","count","(","1",")","AS","num","FROM","airflow.static_babynames","''",">",">",">","ph.get_records","(","sql",")","[","[","340698","]","]"]
code: def get_pandas_df(self, sql: str = "", parameters: Iterable | Mapping[str, Any] | None = None, **kwargs):  # type: ignore[override]
      import pandas as pd
  
      cursor = self.get_cursor()
      try:
          cursor.execute(self.strip_sql_string(sql), parameters)
          data = cursor.fetchall()
      except DatabaseError as e:
          raise TrinoException(e)
      column_descriptions = cursor.description
      if data:
          df = pd.DataFrame(data, **kwargs)
          df.rename(
              columns={
                  n: c[0]
                  for n, c in zip(df.columns, column_descriptions)
              },
              inplace=True,
          )
      else:
          df = pd.DataFrame(**kwargs)
      return df
  
imports: from __future__ import annotations
  import json
  import os
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Iterable, Mapping, TypeVar
  import trino
  from trino.exceptions import DatabaseError
  from trino.transaction import IsolationLevel
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException
  from airflow.providers.common.sql.hooks.sql import DbApiHook
  from airflow.utils.helpers import exactly_one
  from airflow.utils.operator_helpers import AIRFLOW_VAR_NAME_FORMAT_MAPPING, DEFAULT_FORMAT_PREFIX
label_desc: Use image node_id 6 for calling the TrinoHook obj's underlying member method code with example usage: obj.get_pandas_df(sql, parameters) and returns: df