code: def max_partition(
      table,
      schema="default",
      field=None,
      filter_map=None,
      metastore_conn_id="metastore_default",
  ):
      """
      Get the max partition for a table.
  
      :param schema: The hive schema the table lives in
      :param table: The hive table you are interested in, supports the dot
          notation as in "my_database.my_table", if a dot is found,
          the schema param is disregarded
      :param metastore_conn_id: The hive connection you are interested in.
          If your default is set you don't need to use this parameter.
      :param filter_map: partition_key:partition_value map used for partition filtering,
                         e.g. {'key1': 'value1', 'key2': 'value2'}.
                         Only partitions matching all partition_key:partition_value
                         pairs will be considered as candidates of max partition.
      :param field: the field to get the max value from. If there's only
          one partition field, this will be inferred
  
      >>> max_partition("airflow.static_babynames_partitioned")
      '2015-01-01'
      """
      from airflow.providers.apache.hive.hooks.hive import (
          HiveMetastoreHook,
      )
  
      if "." in table:
          schema, table = table.split(".")
      hive_hook = HiveMetastoreHook(metastore_conn_id=metastore_conn_id)
      return hive_hook.max_partition(
          schema=schema,
          table_name=table,
          field=field,
          filter_map=filter_map,
      )
  
imports: from __future__ import annotations
  import datetime
label_desc: Use image node_id 1 for calling a global function with example usage: max_partition(table, schema, field, filter_map, metastore_conn_id) and returns: hive_hook