class_docstr: Interact with AWS Glue Data Catalog.
  
  Provide thin wrapper around :external+boto3:py:class:`boto3.client("glue") <Glue.Client>`.
  
  Additional arguments (such as ``aws_conn_id``) may be specified and
  are passed down to the underlying AwsBaseHook.
  
  .. seealso::
      - :class:`airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
      - `AWS Glue Data Catalog         <https://docs.aws.amazon.com/glue/latest/dg/components-overview.html#data-catalog-intro>`__
docstr: Retrieve the partition values for a table.
  
  .. seealso::
      - :external+boto3:py:class:`Glue.Paginator.GetPartitions`
  
  :param database_name: The name of the catalog database where the partitions reside.
  :param table_name: The name of the partitions' table.
  :param expression: An expression filtering the partitions to be returned.
      Please see official AWS documentation for further information.
      https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-partitions.html#aws-glue-api-catalog-partitions-GetPartitions
  :param page_size: pagination size
  :param max_items: maximum items to return
  :return: set of partition values where each value is a tuple since
      a partition may be composed of multiple columns. For example:
      ``{('2018-01-01','1'), ('2018-01-01','2')}``
docstr_tok: ["Retrieve","the","partition","values","for","a","table",".","..","seealso",":",":","-",":","external+boto3",":","py",":","class",":","`","Glue.Paginator.GetPartitions","`",":","param","database_name",":","The","name","of","the","catalog","database","where","the","partitions","reside",".",":","param","table_name",":","The","name","of","the","partitions","'","table",".",":","param","expression",":","An","expression","filtering","the","partitions","to","be","returned",".","Please","see","official","AWS","documentation","for","further","information",".","https",":","\/\/docs.aws.amazon.com\/glue\/latest\/dg\/aws-glue-api-catalog-partitions.html","#","aws-glue-api-catalog-partitions-GetPartitions",":","param","page_size",":","pagination","size",":","param","max_items",":","maximum","items","to","return",":","return",":","set","of","partition","values","where","each","value","is","a","tuple","since","a","partition","may","be","composed","of","multiple","columns",".","For","example",":","``","{","(","'2018-01-01","'",",","'","1","'",")",",","(","'2018-01-01","'",",","'","2","'",")","}","``"]
code: def get_partitions(
      self,
      database_name: str,
      table_name: str,
      expression: str = "",
      page_size: int | None = None,
      max_items: int | None = None,
  ) -> set[tuple]:
      """
      Retrieve the partition values for a table.
  
      .. seealso::
          - :external+boto3:py:class:`Glue.Paginator.GetPartitions`
  
      :param database_name: The name of the catalog database where the partitions reside.
      :param table_name: The name of the partitions' table.
      :param expression: An expression filtering the partitions to be returned.
          Please see official AWS documentation for further information.
          https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-partitions.html#aws-glue-api-catalog-partitions-GetPartitions
      :param page_size: pagination size
      :param max_items: maximum items to return
      :return: set of partition values where each value is a tuple since
          a partition may be composed of multiple columns. For example:
          ``{('2018-01-01','1'), ('2018-01-01','2')}``
      """
      config = {
          "PageSize": page_size,
          "MaxItems": max_items,
      }
  
      paginator = self.get_conn().get_paginator("get_partitions")
      response = paginator.paginate(
          DatabaseName=database_name,
          TableName=table_name,
          Expression=expression,
          PaginationConfig=config,
      )
  
      partitions = set()
      for page in response:
          for partition in page["Partitions"]:
              partitions.add(tuple(partition["Values"]))
  
      return partitions
  
file_path: airflow/airflow/providers/amazon/aws/hooks/glue_catalog.py
imports: from __future__ import annotations
  from typing import Any
  from botocore.exceptions import ClientError
  from airflow.exceptions import AirflowException
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
label_desc: Use image node_id 2 for calling the GlueCatalogHook obj's underlying member method code with example usage: obj.get_partitions(database_name, table_name, expression, page_size, max_items) and returns: partitions