class_docstr: Interact with Amazon SageMaker.
  
  Provide thick wrapper around
  :external+boto3:py:class:`boto3.client("sagemaker") <SageMaker.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`
class_docstr_tok: ["Interact","with","Amazon","SageMaker",".","Provide","thick","wrapper","around",":","external+boto3",":","py",":","class",":","`","boto3.client","(","``","sagemaker","''",")","<","SageMaker.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","`"]
docstr: Create an auto ML job to predict the given column.
  
  The learning input is based on data provided through S3 , and the output
  is written to the specified S3 location.
  
  .. seealso::
      - :external+boto3:py:meth:`SageMaker.Client.create_auto_ml_job`
  
  :param job_name: Name of the job to create, needs to be unique within the account.
  :param s3_input: The S3 location (folder or file) where to fetch the data.
      By default, it expects csv with headers.
  :param target_attribute: The name of the column containing the values to predict.
  :param s3_output: The S3 folder where to write the model artifacts. Must be 128 characters or fewer.
  :param role_arn: The ARN or the IAM role to use when interacting with S3.
      Must have read access to the input, and write access to the output folder.
  :param compressed_input: Set to True if the input is gzipped.
  :param time_limit: The maximum amount of time in seconds to spend training the model(s).
  :param autodeploy_endpoint_name: If specified, the best model will be deployed to an endpoint with
      that name. No deployment made otherwise.
  :param extras: Use this dictionary to set any variable input variable for job creation that is not
      offered through the parameters of this function. The format is described in:
      https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client.create_auto_ml_job
  :param wait_for_completion: Whether to wait for the job to finish before returning. Defaults to True.
  :param check_interval: Interval in seconds between 2 status checks when waiting for completion.
  
  :returns: Only if waiting for completion, a dictionary detailing the best model. The structure is that
      of the "BestCandidate" key in:
      https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client.describe_auto_ml_job
code: def create_auto_ml_job(
      self,
      job_name: str,
      s3_input: str,
      target_attribute: str,
      s3_output: str,
      role_arn: str,
      compressed_input: bool = False,
      time_limit: int | None = None,
      autodeploy_endpoint_name: str | None = None,
      extras: dict | None = None,
      wait_for_completion: bool = True,
      check_interval: int = 30,
  ) -> dict | None:
      """Create an auto ML job to predict the given column.
  
      The learning input is based on data provided through S3 , and the output
      is written to the specified S3 location.
  
      .. seealso::
          - :external+boto3:py:meth:`SageMaker.Client.create_auto_ml_job`
  
      :param job_name: Name of the job to create, needs to be unique within the account.
      :param s3_input: The S3 location (folder or file) where to fetch the data.
          By default, it expects csv with headers.
      :param target_attribute: The name of the column containing the values to predict.
      :param s3_output: The S3 folder where to write the model artifacts. Must be 128 characters or fewer.
      :param role_arn: The ARN or the IAM role to use when interacting with S3.
          Must have read access to the input, and write access to the output folder.
      :param compressed_input: Set to True if the input is gzipped.
      :param time_limit: The maximum amount of time in seconds to spend training the model(s).
      :param autodeploy_endpoint_name: If specified, the best model will be deployed to an endpoint with
          that name. No deployment made otherwise.
      :param extras: Use this dictionary to set any variable input variable for job creation that is not
          offered through the parameters of this function. The format is described in:
          https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client.create_auto_ml_job
      :param wait_for_completion: Whether to wait for the job to finish before returning. Defaults to True.
      :param check_interval: Interval in seconds between 2 status checks when waiting for completion.
  
      :returns: Only if waiting for completion, a dictionary detailing the best model. The structure is that
          of the "BestCandidate" key in:
          https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client.describe_auto_ml_job
      """
      input_data = [
          {
              "DataSource": {
                  "S3DataSource": {
                      "S3DataType": "S3Prefix",
                      "S3Uri": s3_input,
                  }
              },
              "TargetAttributeName": target_attribute,
          },
      ]
      params_dict = {
          "AutoMLJobName": job_name,
          "InputDataConfig": input_data,
          "OutputDataConfig": {"S3OutputPath": s3_output},
          "RoleArn": role_arn,
      }
      if compressed_input:
          input_data[0]["CompressionType"] = "Gzip"
      if time_limit:
          params_dict.update(
              {
                  "AutoMLJobConfig": {
                      "CompletionCriteria": {
                          "MaxAutoMLJobRuntimeInSeconds": time_limit
                      }
                  }
              }
          )
      if autodeploy_endpoint_name:
          params_dict.update(
              {
                  "ModelDeployConfig": {
                      "EndpointName": autodeploy_endpoint_name
                  }
              }
          )
      if extras:
          params_dict.update(extras)
  
      # returns the job ARN, but we don't need it because we access it by its name
      self.conn.create_auto_ml_job(**params_dict)
  
      if wait_for_completion:
          res = self.check_status(
              job_name,
              "AutoMLJobStatus",
              # cannot pass the function directly because the parameter needs to be named
              self._describe_auto_ml_job,
              check_interval,
          )
          if "BestCandidate" in res:
              return res["BestCandidate"]
      return None
  
imports: from __future__ import annotations
  import os
  import re
  import tarfile
  import tempfile
  import time
  import warnings
  from collections import Counter, namedtuple
  from datetime import datetime
  from functools import partial
  from typing import Any, Callable, Generator, cast
  from botocore.exceptions import ClientError
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.providers.amazon.aws.hooks.logs import AwsLogsHook
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
  from airflow.providers.amazon.aws.utils.tags import format_tags
  from airflow.utils import timezone
label_desc: Use image node_id 39 for calling the SageMakerHook obj's underlying member method code with example usage: obj.create_auto_ml_job(job_name, s3_input, target_attribute, s3_output, role_arn, compressed_input, time_limit, autodeploy_endpoint_name, extras, wait_for_completion, check_interval) and returns: None, res