astronomer.providers.amazon.aws.hooks.sagemaker

Module Contents

Classes

SageMakerHookAsync

Interact with Amazon SageMaker async using aiobotocore python library.

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.

NON_TERMINAL_STATES = ('InProgress', 'Stopping', 'Stopped')
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.