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","]","]"]
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 trino 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, replace
      )
  
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 7 for calling the TrinoHook obj's underlying member method code with example usage: obj.insert_rows(table, rows, target_fields, commit_every, replace) without return types