class_docstr: Performs one or more of the checks provided in the checks dictionary.
  
  Checks should be written to return a boolean result.
  
  :param table: the table to run checks on
  :param checks: the dictionary of checks, where check names are followed by a dictionary containing at
      least a check statement, and optionally a partition clause, e.g.:
  
      .. code-block:: python
  
          {
              "row_count_check": {"check_statement": "COUNT(*) = 1000"},
              "column_sum_check": {"check_statement": "col_a + col_b < col_c"},
              "third_check": {"check_statement": "MIN(col) = 1", "partition_clause": "col IS NOT NULL"},
          }
  
  
  :param partition_clause: a partial SQL statement that is added to a WHERE clause in the query built by
      the operator that creates partition_clauses for the checks to run on, e.g.
  
      .. code-block:: python
  
          "date = '1970-01-01'"
  
  :param conn_id: the connection ID used to connect to the database
  :param database: name of database which overwrite the defined one in connection
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:SQLTableCheckOperator`
class_docstr_tok: ["Performs","one","or","more","of","the","checks","provided","in","the","checks","dictionary",".","Checks","should","be","written","to","return","a","boolean","result",".",":","param","table",":","the","table","to","run","checks","on",":","param","checks",":","the","dictionary","of","checks",",","where","check","names","are","followed","by","a","dictionary","containing","at","least","a","check","statement",",","and","optionally","a","partition","clause",",","e.g",".",":","..","code-block",":",":","python","{","``","row_count_check","''",":","{","``","check_statement","''",":","``","COUNT","(","*",")","=","1000","''","}",",","``","column_sum_check","''",":","{","``","check_statement","''",":","``","col_a","+","col_b","<","col_c","''","}",",","``","third_check","''",":","{","``","check_statement","''",":","``","MIN","(","col",")","=","1","''",",","``","partition_clause","''",":","``","col","IS","NOT","NULL","''","}",",","}",":","param","partition_clause",":","a","partial","SQL","statement","that","is","added","to","a","WHERE","clause","in","the","query","built","by","the","operator","that","creates","partition_clauses","for","the","checks","to","run","on",",","e.g",".","..","code-block",":",":","python","``","date","=","'1970-01-01","'","''",":","param","conn_id",":","the","connection","ID","used","to","connect","to","the","database",":","param","database",":","name","of","database","which","overwrite","the","defined","one","in","connection","..","seealso",":",":","For","more","information","on","how","to","use","this","operator",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/operator",":","SQLTableCheckOperator","`"]
code: def _generate_sql_query(self):
      self.log.debug("Partition clause: %s", self.partition_clause)
  
      def _generate_partition_clause(check_name):
          if (
              self.partition_clause
              and "partition_clause" not in self.checks[check_name]
          ):
              return f"WHERE {self.partition_clause}"
          elif (
              not self.partition_clause
              and "partition_clause" in self.checks[check_name]
          ):
              return (
                  f"WHERE {self.checks[check_name]['partition_clause']}"
              )
          elif (
              self.partition_clause
              and "partition_clause" in self.checks[check_name]
          ):
              return f"WHERE {self.partition_clause} AND {self.checks[check_name]['partition_clause']}"
          else:
              return ""
  
      return "UNION ALL".join(
          self.sql_check_template.format(
              check_statement=value["check_statement"],
              check_name=check_name,
              table=self.table,
              partition_clause=_generate_partition_clause(check_name),
          )
          for check_name, value in self.checks.items()
      )
  
imports: from __future__ import annotations
  import ast
  import re
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Callable, Iterable, Mapping, NoReturn, Sequence, SupportsAbs
  from airflow.exceptions import AirflowException, AirflowFailException
  from airflow.hooks.base import BaseHook
  from airflow.models import BaseOperator, SkipMixin
  from airflow.providers.common.sql.hooks.sql import DbApiHook, fetch_all_handler, return_single_query_results
  from airflow.utils.helpers import merge_dicts
label_desc: Use image node_id 3 for calling the SQLTableCheckOperator obj's underlying member method code with example usage: obj._generate_sql_query() and returns: str, str, self, str, self, str, self, str, self, str