class_docstr: Interacts with AWS Glue Crawler.
  
  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 crawlers and classifiers         <https://docs.aws.amazon.com/glue/latest/dg/components-overview.html#crawling-intro>`__
class_docstr_tok: ["Interacts","with","AWS","Glue","Crawler",".","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","crawlers","and","classifiers","<","https",":","\/\/docs.aws.amazon.com\/glue\/latest\/dg\/components-overview.html","#","crawling-intro",">","`","__"]
docstr: Update crawler tags.
  
  .. seealso::
      - :external+boto3:py:meth:`Glue.Client.tag_resource`
  
  :param crawler_name: Name of the crawler for which to update tags
  :param crawler_tags: Dictionary of new tags. If empty, all tags will be deleted
  :return: True if tags were updated and false otherwise
docstr_tok: ["Update","crawler","tags",".","..","seealso",":",":","-",":","external+boto3",":","py",":","meth",":","`","Glue.Client.tag_resource","`",":","param","crawler_name",":","Name","of","the","crawler","for","which","to","update","tags",":","param","crawler_tags",":","Dictionary","of","new","tags",".","If","empty",",","all","tags","will","be","deleted",":","return",":","True","if","tags","were","updated","and","false","otherwise"]
code: def update_tags(self, crawler_name: str, crawler_tags: dict) -> bool:
      """
      Update crawler tags.
  
      .. seealso::
          - :external+boto3:py:meth:`Glue.Client.tag_resource`
  
      :param crawler_name: Name of the crawler for which to update tags
      :param crawler_tags: Dictionary of new tags. If empty, all tags will be deleted
      :return: True if tags were updated and false otherwise
      """
      account_number = StsHook(
          aws_conn_id=self.aws_conn_id
      ).get_account_number()
      crawler_arn = f"arn:{self.conn_partition}:glue:{self.conn_region_name}:{account_number}:crawler/{crawler_name}"
      current_crawler_tags: dict = self.glue_client.get_tags(
          ResourceArn=crawler_arn
      )["Tags"]
  
      update_tags = {}
      delete_tags = []
      for key, value in current_crawler_tags.items():
          wanted_tag_value = crawler_tags.get(key, None)
          if wanted_tag_value is None:
              # key is missing from new configuration, mark it for deletion
              delete_tags.append(key)
          elif wanted_tag_value != value:
              update_tags[key] = wanted_tag_value
  
      updated_tags = False
      if update_tags:
          self.log.info("Updating crawler tags: %s", crawler_name)
          self.glue_client.tag_resource(
              ResourceArn=crawler_arn, TagsToAdd=update_tags
          )
          self.log.info("Updated crawler tags: %s", crawler_name)
          updated_tags = True
      if delete_tags:
          self.log.info("Deleting crawler tags: %s", crawler_name)
          self.glue_client.untag_resource(
              ResourceArn=crawler_arn, TagsToRemove=delete_tags
          )
          self.log.info("Deleted crawler tags: %s", crawler_name)
          updated_tags = True
      return updated_tags
  
file_path: airflow/airflow/providers/amazon/aws/hooks/glue_crawler.py
imports: from __future__ import annotations
  from functools import cached_property
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.providers.amazon.aws.hooks.sts import StsHook
label_desc: Use image node_id 6 for calling the GlueCrawlerHook obj's underlying member method code with example usage: obj.update_tags(crawler_name, crawler_tags) and returns: updated_tags