astronomer.providers.amazon.aws.hooks.sagemaker

Classes

SageMakerHookAsync

Interact with Amazon SageMaker async using aiobotocore python library.

Module Contents

class astronomer.providers.amazon.aws.hooks.sagemaker.SageMakerHookAsync(*args, **kwargs)[source]

Bases: astronomer.providers.amazon.aws.hooks.base_aws.AwsBaseHookAsync

Interact with Amazon SageMaker async using aiobotocore python library.

Additional arguments (such as aws_conn_id) may be specified and are passed down to the underlying AwsBaseHookAsync.

This class is deprecated and will be removed in 2.0.0. Use :class: ~airflow.providers.amazon.aws.hooks.sagemaker.SageMakerHook instead

NON_TERMINAL_STATES = ('InProgress', 'Stopping', 'Stopped')
s3_hook
logs_hook_async
async describe_transform_job_async(job_name)[source]

Return the transform job info associated with the name

Parameters:

job_name (str) – the name of the transform job

async describe_processing_job_async(job_name)[source]

Return the processing job info associated with the name

Parameters:

job_name (str) – the name of the processing job

async describe_training_job_async(job_name)[source]

Return the training job info associated with the name

Parameters:

job_name (str) – the name of the training job

async describe_training_job_with_log(job_name, positions, stream_names, instance_count, state, last_description, last_describe_job_call)[source]

Return the training job info associated with job_name and print CloudWatch logs

Parameters:
  • job_name (str) – name of the job to check status

  • positions (dict[str, Any]) – A list of pairs of (timestamp, skip) which represents the last record read from each stream.

  • stream_names (list[str]) – A list of the log stream names. The position of the stream in this list is the stream number.

  • instance_count (int) – Count of the instance created for the job initially

  • state (int) – log state

  • last_description (dict[str, Any]) – Latest description of the training job

  • last_describe_job_call (float) – previous job called time

async get_multi_stream(log_group, streams, positions)[source]

Iterate over the available events coming from a set of log streams in a single log group interleaving the events from each stream so they’re yielded in timestamp order.

Parameters:
  • log_group (str) – The name of the log group.

  • streams (list[str]) – A list of the log stream names. The position of the stream in this list is the stream number.

  • positions (dict[str, Any]) – A list of pairs of (timestamp, skip) which represents the last record read from each stream.