airflow.providers.amazon.aws.sensors.sagemaker_unified_studio_notebook

This module contains the Amazon SageMaker Unified Studio Notebook Run sensor.

This sensor polls the DataZone GetNotebookRun API until the notebook run reaches a terminal state.

Classes

SageMakerUnifiedStudioNotebookSensor

Polls a SageMaker Unified Studio notebook execution until it reaches a terminal state.

Module Contents

class airflow.providers.amazon.aws.sensors.sagemaker_unified_studio_notebook.SageMakerUnifiedStudioNotebookSensor(*, domain_identifier, owning_project_identifier, notebook_run_id, notebook_identifier, endpoint_url=None, **kwargs)[source]

Bases: airflow.providers.amazon.aws.sensors.base_aws.AwsBaseSensor[airflow.providers.amazon.aws.hooks.sagemaker_unified_studio_notebook.SageMakerUnifiedStudioNotebookHook]

Polls a SageMaker Unified Studio notebook execution until it reaches a terminal state.

‘SUCCEEDED’, ‘FAILED’, ‘STOPPED’

Examples:
from airflow.providers.amazon.aws.sensors.sagemaker_unified_studio_notebook import (
    SageMakerUnifiedStudioNotebookSensor,
)

notebook_sensor = SageMakerUnifiedStudioNotebookSensor(
    task_id="wait_for_notebook",
    domain_identifier="dzd_example",
    owning_project_identifier="proj_example",
    notebook_run_id="nr-1234567890",
)
Parameters:
  • domain_identifier (str) – The ID of the SageMaker Unified Studio domain containing the notebook.

  • owning_project_identifier (str) – The ID of the SageMaker Unified Studio project containing the notebook.

  • notebook_run_id (str) – The ID of the notebook run to monitor. This is returned by the SageMakerUnifiedStudioNotebookOperator.

  • notebook_identifier (str) – The ID of the notebook that was executed. Required to read notebook outputs from S3 after the run completes.

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
domain_identifier[source]
owning_project_identifier[source]
notebook_run_id[source]
notebook_identifier[source]
endpoint_url = None[source]
poke(context)[source]

Override when deriving this class.

execute(context)[source]

Derive when creating an operator.

The main method to execute the task. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?