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: A generic way to insert a set of tuples into a table.
  
  :param table: Name of the target table
  :param rows: The rows to insert into the table
  :param target_fields: The names of the columns to fill in the table
  :param commit_every: The maximum number of rows to insert in one
      transaction. Set to 0 to insert all rows in one transaction.
  :param replace: Whether to replace instead of insert
docstr_tok: ["A","generic","way","to","insert","a","set","of","tuples","into","a","table",".",":","param","table",":","Name","of","the","target","table",":","param","rows",":","The","rows","to","insert","into","the","table",":","param","target_fields",":","The","names","of","the","columns","to","fill","in","the","table",":","param","commit_every",":","The","maximum","number","of","rows","to","insert","in","one","transaction",".","Set","to","0","to","insert","all","rows","in","one","transaction",".",":","param","replace",":","Whether","to","replace","instead","of","insert"]
code: def insert_rows(
      self,
      table: str,
      rows: Iterable[tuple],
      target_fields: Iterable[str] | None = None,
      commit_every: int = 0,
      replace: bool = False,
      **kwargs,
  ) -> None:
      """
      A generic way to insert a set of tuples into a table.
  
      :param table: Name of the target table
      :param rows: The rows to insert into the table
      :param target_fields: The names of the columns to fill in the table
      :param commit_every: The maximum number of rows to insert in one
          transaction. Set to 0 to insert all rows in one transaction.
      :param replace: Whether to replace instead of insert
      """
      if self.get_isolation_level() == IsolationLevel.AUTOCOMMIT:
          self.log.info(
              "Transactions are not enable in presto connection. "
              "Please use the isolation_level property to enable it. "
              "Falling back to insert all rows in one transaction."
          )
          commit_every = 0
  
      super().insert_rows(table, rows, target_fields, commit_every)
  
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 7 for calling the PrestoHook obj's underlying member method code with example usage: obj.insert_rows(table, rows, target_fields, commit_every, replace) without return types