class_docstr: Wrapper to interact with the Hive Metastore.
  
  :param metastore_conn_id: reference to the
      :ref: `metastore thrift service connection id <howto/connection:hive_metastore>`.
class_docstr_tok: ["Wrapper","to","interact","with","the","Hive","Metastore",".",":","param","metastore_conn_id",":","reference","to","the",":","ref",":","`","metastore","thrift","service","connection","id","<","howto\/connection",":","hive_metastore",">","`","."]
docstr: Check whether a partition exists.
  
  :param schema: Name of hive schema (database) @table belongs to
  :param table: Name of hive table @partition belongs to
  :param partition: Expression that matches the partitions to check for (e.g. `a = 'b' AND c = 'd'`)
  
  >>> hh = HiveMetastoreHook()
  >>> t = "static_babynames_partitioned"
  >>> hh.check_for_partition("airflow", t, "ds='2015-01-01'")
  True
docstr_tok: ["Check","whether","a","partition","exists",".",":","param","schema",":","Name","of","hive","schema","(","database",")","@","table","belongs","to",":","param","table",":","Name","of","hive","table","@","partition","belongs","to",":","param","partition",":","Expression","that","matches","the","partitions","to","check","for","(","e.g",".","`","a","=","'","b","'","AND","c","=","'d","'","`",")",">",">",">","hh","=","HiveMetastoreHook","(",")",">",">",">","t","=","``","static_babynames_partitioned","''",">",">",">","hh.check_for_partition","(","``","airflow","''",",","t",",","``","ds='2015-01-01","'","''",")","True"]
code: def check_for_partition(
      self, schema: str, table: str, partition: str
  ) -> bool:
      """
      Check whether a partition exists.
  
      :param schema: Name of hive schema (database) @table belongs to
      :param table: Name of hive table @partition belongs to
      :param partition: Expression that matches the partitions to check for (e.g. `a = 'b' AND c = 'd'`)
  
      >>> hh = HiveMetastoreHook()
      >>> t = "static_babynames_partitioned"
      >>> hh.check_for_partition("airflow", t, "ds='2015-01-01'")
      True
      """
      with self.metastore as client:
          partitions = client.get_partitions_by_filter(
              schema, table, partition, HiveMetastoreHook.MAX_PART_COUNT
          )
  
      return bool(partitions)
  
imports: from __future__ import annotations
  import contextlib
  import os
  import re
  import socket
  import subprocess
  import time
  import warnings
  from tempfile import NamedTemporaryFile, TemporaryDirectory
  from typing import TYPE_CHECKING, Any, Iterable, Mapping
  from airflow.exceptions import AirflowProviderDeprecationWarning
  import csv
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException
  from airflow.hooks.base import BaseHook
  from airflow.providers.common.sql.hooks.sql import DbApiHook
  from airflow.security import utils
  from airflow.utils.helpers import as_flattened_list
  from airflow.utils.operator_helpers import AIRFLOW_VAR_NAME_FORMAT_MAPPING
label_desc: Use image node_id 7 for calling the HiveMetastoreHook obj's underlying member method code with example usage: obj.check_for_partition(schema, table, partition) and returns: bool