class_docstr: Abstract base class for sql hooks.
  
  When subclassing, maintainers can override the `_make_common_data_structure` method:
  This method transforms the result of the handler method (typically `cursor.fetchall()`) into
  objects common across all Hooks derived from this class (tuples). Most of the time, the underlying SQL
  library already returns tuples from its cursor, and the `_make_common_data_structure` method can be ignored.
  
  :param schema: Optional DB schema that overrides the schema specified in the connection. Make sure that
      if you change the schema parameter value in the constructor of the derived Hook, such change
      should be done before calling the ``DBApiHook.__init__()``.
  :param log_sql: Whether to log SQL query when it's executed. Defaults to *True*.
class_docstr_tok: ["Abstract","base","class","for","sql","hooks",".","When","subclassing",",","maintainers","can","override","the","`","_make_common_data_structure","`","method",":","This","method","transforms","the","result","of","the","handler","method","(","typically","`","cursor.fetchall","(",")","`",")","into","objects","common","across","all","Hooks","derived","from","this","class","(","tuples",")",".","Most","of","the","time",",","the","underlying","SQL","library","already","returns","tuples","from","its","cursor",",","and","the","`","_make_common_data_structure","`","method","can","be","ignored",".",":","param","schema",":","Optional","DB","schema","that","overrides","the","schema","specified","in","the","connection",".","Make","sure","that","if","you","change","the","schema","parameter","value","in","the","constructor","of","the","derived","Hook",",","such","change","should","be","done","before","calling","the","``","DBApiHook.__init__","(",")","``",".",":","param","log_sql",":","Whether","to","log","SQL","query","when","it","'s","executed",".","Defaults","to","*","True","*","."]
docstr: Ensure the data returned from an SQL command is a standard tuple or list[tuple].
  
  This method is intended to be overridden by subclasses of the `DbApiHook`. Its purpose is to
  transform the result of an SQL command (typically returned by cursor methods) into a common
  data structure (a tuple or list[tuple]) across all DBApiHook derived Hooks, as defined in the
  ADR-0002 of the sql provider.
  
  If this method is not overridden, the result data is returned as-is. If the output of the cursor
  is already a common data structure, this method should be ignored.
docstr_tok: ["Ensure","the","data","returned","from","an","SQL","command","is","a","standard","tuple","or","list","[","tuple","]",".","This","method","is","intended","to","be","overridden","by","subclasses","of","the","`","DbApiHook","`",".","Its","purpose","is","to","transform","the","result","of","an","SQL","command","(","typically","returned","by","cursor","methods",")","into","a","common","data","structure","(","a","tuple","or","list","[","tuple","]",")","across","all","DBApiHook","derived","Hooks",",","as","defined","in","the","ADR-0002","of","the","sql","provider",".","If","this","method","is","not","overridden",",","the","result","data","is","returned","as-is",".","If","the","output","of","the","cursor","is","already","a","common","data","structure",",","this","method","should","be","ignored","."]
code: def _make_common_data_structure(
      self, result: T | Sequence[T]
  ) -> tuple | list[tuple]:
      """Ensure the data returned from an SQL command is a standard tuple or list[tuple].
  
      This method is intended to be overridden by subclasses of the `DbApiHook`. Its purpose is to
      transform the result of an SQL command (typically returned by cursor methods) into a common
      data structure (a tuple or list[tuple]) across all DBApiHook derived Hooks, as defined in the
      ADR-0002 of the sql provider.
  
      If this method is not overridden, the result data is returned as-is. If the output of the cursor
      is already a common data structure, this method should be ignored.
      """
      # Back-compatibility call for providers implementing old ´_make_serializable' method.
      with contextlib.suppress(AttributeError):
          result = self._make_serializable(result=result)  # type: ignore[attr-defined]
          warnings.warn(
              "The `_make_serializable` method is deprecated and support will be removed in a future "
              f"version of the common.sql provider. Please update the {self.__class__.__name__}'s provider "
              "to a version based on common.sql >= 1.9.1.",
              AirflowProviderDeprecationWarning,
              stacklevel=2,
          )
  
      if isinstance(result, Sequence):
          return cast(List[tuple], result)
      return cast(tuple, result)
  
imports: from __future__ import annotations
  import contextlib
  import warnings
  from contextlib import closing
  from datetime import datetime
  from typing import TYPE_CHECKING, Any, Callable, Generator, Iterable, List, Mapping, Protocol, Sequence, TypeVar, cast, overload
  from urllib.parse import urlparse
  import sqlparse
  from sqlalchemy import create_engine
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.hooks.base import BaseHook
label_desc: Use image node_id 16 for calling the DbApiHook obj's underlying member method code with example usage: obj._make_common_data_structure(result) and returns: cast, cast