class_docstr: Interact with Presto through prestodb.
  
  >>> ph = PrestoHook()
  >>> sql = "SELECT count(1) AS num FROM airflow.static_babynames"
  >>> ph.get_records(sql)
  [[340698]]
docstr: Returns a connection object.
docstr_tok: ["Returns","a","connection","object","."]
code: def get_conn(self) -> Connection:
      """Returns a connection object."""
      db = self.get_connection(self.presto_conn_id)  # type: ignore[attr-defined]
      extra = db.extra_dejson
      auth = None
      if db.password and extra.get("auth") == "kerberos":
          raise AirflowException(
              "Kerberos authorization doesn't support password."
          )
      elif db.password:
          auth = prestodb.auth.BasicAuthentication(
              db.login, db.password
          )
      elif extra.get("auth") == "kerberos":
          auth = prestodb.auth.KerberosAuthentication(
              config=extra.get(
                  "kerberos__config", os.environ.get("KRB5_CONFIG")
              ),
              service_name=extra.get("kerberos__service_name"),
              mutual_authentication=_boolify(
                  extra.get("kerberos__mutual_authentication", False)
              ),
              force_preemptive=_boolify(
                  extra.get("kerberos__force_preemptive", False)
              ),
              hostname_override=extra.get(
                  "kerberos__hostname_override"
              ),
              sanitize_mutual_error_response=_boolify(
                  extra.get(
                      "kerberos__sanitize_mutual_error_response", True
                  )
              ),
              principal=extra.get(
                  "kerberos__principal",
                  conf.get("kerberos", "principal"),
              ),
              delegate=_boolify(extra.get("kerberos__delegate", False)),
              ca_bundle=extra.get("kerberos__ca_bundle"),
          )
  
      http_headers = {
          "X-Presto-Client-Info": generate_presto_client_info()
      }
      presto_conn = prestodb.dbapi.connect(
          host=db.host,
          port=db.port,
          user=db.login,
          source=db.extra_dejson.get("source", "airflow"),
          http_headers=http_headers,
          http_scheme=db.extra_dejson.get("protocol", "http"),
          catalog=db.extra_dejson.get("catalog", "hive"),
          schema=db.schema,
          auth=auth,
          isolation_level=self.get_isolation_level(),  # type: ignore[func-returns-value]
      )
      if extra.get("verify") is not None:
          # Unfortunately verify parameter is available via public API.
          # The PR is merged in the presto library, but has not been released.
          # See: https://github.com/prestosql/presto-python-client/pull/31
          presto_conn._http_session.verify = _boolify(extra["verify"])
  
      return presto_conn
  
imports: from __future__ import annotations
  import json
  import os
  from typing import TYPE_CHECKING, Any, Iterable, Mapping, TypeVar
  import prestodb
  from prestodb.exceptions import DatabaseError
  from prestodb.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.operator_helpers import AIRFLOW_VAR_NAME_FORMAT_MAPPING, DEFAULT_FORMAT_PREFIX
label_desc: Use image node_id 2 for calling the PrestoHook obj's underlying member method code with example usage: obj.get_conn() and returns: presto_conn