airflow/contrib/hooks/aws_glue_catalog_hook.py
def check_for_partition(self, database_name, table_name, expression):
        """
        Checks whether a partition exists

        :param database_name: Name of hive database (schema) @table belongs to
        :type database_name: str
        :param table_name: Name of hive table @partition belongs to
        :type table_name: str
        :expression: Expression that matches the partitions to check for
            (eg `a = 'b' AND c = 'd'`)
        :type expression: str
        :rtype: bool

        >>> hook = AwsGlueCatalogHook()
        >>> t = 'static_babynames_partitioned'
        >>> hook.check_for_partition('airflow', t, "ds='2015-01-01'")
        True
        """
        partitions = self.get_partitions(database_name, table_name, expression, max_items=1)

        if partitions:
            return True
        else:
            return False
def check_for_partition(self, database_name, table_name, expression):
        """
        Checks whether a partition exists

        :param database_name: Name of hive database (schema) @table belongs to
        :type database_name: str
        :param table_name: Name of hive table @partition belongs to
        :type table_name: str
        :expression: Expression that matches the partitions to check for
            (eg `a = 'b' AND c = 'd'`)
        :type expression: str
        :rtype: bool

        >>> hook = AwsGlueCatalogHook()
        >>> t = 'static_babynames_partitioned'
        >>> hook.check_for_partition('airflow', t, "ds='2015-01-01'")
        True
        """
        partitions = self.get_partitions(database_name, table_name, expression, max_items=1)

        if partitions:
            return True
        else:
            return False
Checks whether a partition exists

        :param database_name: Name of hive database (schema) @table belongs to
        :type database_name: str
        :param table_name: Name of hive table @partition belongs to
        :type table_name: str
        :expression: Expression that matches the partitions to check for
            (eg `a = 'b' AND c = 'd'`)
        :type expression: str
        :rtype: bool

        >>> hook = AwsGlueCatalogHook()
        >>> t = 'static_babynames_partitioned'
        >>> hook.check_for_partition('airflow', t, "ds='2015-01-01'")
        True