code: def get_table_schemas(
      hook: BaseHook,
      namespace: str,
      schema: str | None,
      database: str | None,
      in_query: str | None,
      out_query: str | None,
  ) -> tuple[list[Dataset], list[Dataset]]:
      """Query database for table schemas.
  
      Uses provided hook. Responsibility to provide queries for this function is on particular extractors.
      If query for input or output table isn't provided, the query is skipped.
      """
      # Do not query if we did not get both queries
      if not in_query and not out_query:
          return [], []
  
      with closing(hook.get_conn()) as conn, closing(
          conn.cursor()
      ) as cursor:
          if in_query:
              cursor.execute(in_query)
              in_datasets = [
                  x.to_dataset(namespace, database, schema)
                  for x in parse_query_result(cursor)
              ]
          else:
              in_datasets = []
          if out_query:
              cursor.execute(out_query)
              out_datasets = [
                  x.to_dataset(namespace, database, schema)
                  for x in parse_query_result(cursor)
              ]
          else:
              out_datasets = []
      return in_datasets, out_datasets
  
file_path: airflow/airflow/providers/openlineage/utils/sql.py
imports: from __future__ import annotations
  from collections import defaultdict
  from contextlib import closing
  from enum import IntEnum
  from typing import TYPE_CHECKING, Dict, List, Optional
  from attrs import define
  from openlineage.client.facet import SchemaDatasetFacet, SchemaField
  from openlineage.client.run import Dataset
  from sqlalchemy import Column, MetaData, Table, and_, or_, union_all
label_desc: Use image node_id 1 for calling a global function with example usage: get_table_schemas(hook, namespace, schema, database, in_query, out_query) and returns: in_datasets,  out_datasets, list,  list