'Checks whether a partition exists
:param schema: Name of hive schema (database) @table belongs to
:type schema: string
:param table: Name of hive table @partition belongs to
:type schema: string
:partition: Expression that matches the partitions to check for
(eg `a = \'b\' AND c = \'d\'`)
:type schema: string
:rtype: boolean
>>> hh = HiveMetastoreHook()
>>> t = \'static_babynames_partitioned\'
>>> hh.check_for_partition(\'airflow\', t, "ds=\'2015-01-01\'")
True'

def check_for_partition(self, schema, table, partition):

    self.metastore._oprot.trans.open()
    partitions = self.metastore.get_partitions_by_filter(schema, table, partition, 1)
    self.metastore._oprot.trans.close()
    if partitions:
        return True
    else:
        return False
