Lineage

Artifact

class sagemaker.lineage.artifact.Artifact(sagemaker_session=None, **kwargs)

An Amazon SageMaker artifact, which is part of a SageMaker lineage.

Examples

from sagemaker.lineage import artifact

my_artifact = artifact.Artifact.create(
    artifact_name='MyArtifact',
    artifact_type='S3File',
    source_uri='s3://...')

my_artifact.properties["added"] = "property"
my_artifact.save()

for artfct in artifact.Artifact.list():
    print(artfct)

my_artifact.delete()
artifact_arn

The ARN of the artifact.

Type

str

artifact_name

The name of the artifact.

Type

str

artifact_type

The type of the artifact.

Type

str

source

The source of the artifact with a URI and types.

Type

obj

properties

Dictionary of properties.

Type

dict

tags

A list of tags to associate with the artifact.

Type

List[dict[str, str]]

creation_time

When the artifact was created.

Type

datetime

created_by

Contextual info on which account created the artifact.

Type

obj

last_modified_time

When the artifact was last modified.

Type

datetime

last_modified_by

Contextual info on which account created the artifact.

Type

obj

Init Record.

class sagemaker.lineage.artifact.ModelArtifact(sagemaker_session=None, **kwargs)

A SageMaker lineage artifact representing a model.

Common model specific lineage traversals to discover how the model is connected to other entities.

Init Record.

class sagemaker.lineage.artifact.DatasetArtifact(sagemaker_session=None, **kwargs)

A SageMaker Lineage artifact representing a dataset.

Encapsulates common dataset specific lineage traversals to discover how the dataset is connect to related entities.

Init Record.

class sagemaker.lineage.artifact.ImageArtifact(sagemaker_session=None, **kwargs)

A SageMaker lineage artifact representing an image.

Common model specific lineage traversals to discover how the image is connected to other entities.

Init Record.

Actions

class sagemaker.lineage.action.Action(sagemaker_session=None, **kwargs)

An Amazon SageMaker action, which is part of a SageMaker lineage.

Examples

from sagemaker.lineage import action

my_action = action.Action.create(
    action_name='MyAction',
    action_type='EndpointDeployment',
    source_uri='s3://...')

my_action.properties["added"] = "property"
my_action.save()

for actn in action.Action.list():
    print(actn)

my_action.delete()
action_arn

The ARN of the action.

Type

str

action_name

The name of the action.

Type

str

action_type

The type of the action.

Type

str

description

A description of the action.

Type

str

status

The status of the action.

Type

str

source

The source of the action with a URI and type.

Type

obj

properties

Dictionary of properties.

Type

dict

tags

A list of tags to associate with the action.

Type

List[dict[str, str]]

creation_time

When the action was created.

Type

datetime

created_by

Contextual info on which account created the action.

Type

obj

last_modified_time

When the action was last modified.

Type

datetime

last_modified_by

Contextual info on which account created the action.

Type

obj

Init Record.

class sagemaker.lineage.action.ModelPackageApprovalAction(sagemaker_session=None, **kwargs)

An Amazon SageMaker model package approval action, which is part of a SageMaker lineage.

Init Record.

Association

class sagemaker.lineage.association.Association(sagemaker_session=None, **kwargs)

An Amazon SageMaker artifact, which is part of a SageMaker lineage.

Examples

from sagemaker.lineage import association

my_association = association.Association.create(
    source_arn=artifact_arn,
    destination_arn=trial_component_arn,
    association_type='ContributedTo')

for assoctn in association.Association.list():
    print(assoctn)

my_association.delete()
source_arn

The ARN of the source entity.

Type

str

source_type

The type of the source entity.

Type

str

destination_arn

The ARN of the destination entity.

Type

str

destination_type

The type of the destination entity.

Type

str

association_type

the type of the association.

Type

str

Init Record.

Context

class sagemaker.lineage.context.Context(sagemaker_session=None, **kwargs)

An Amazon SageMaker context, which is part of a SageMaker lineage.

context_arn

The ARN of the context.

Type

str

context_name

The name of the context.

Type

str

context_type

The type of the context.

Type

str

description

A description of the context.

Type

str

source

The source of the context with a URI and type.

Type

obj

properties

Dictionary of properties.

Type

dict

tags

A list of tags to associate with the context.

Type

List[dict[str, str]]

creation_time

When the context was created.

Type

datetime

created_by

Contextual info on which account created the context.

Type

obj

last_modified_time

When the context was last modified.

Type

datetime

last_modified_by

Contextual info on which account created the context.

Type

obj

Init Record.

class sagemaker.lineage.context.EndpointContext(sagemaker_session=None, **kwargs)

An Amazon SageMaker endpoint context, which is part of a SageMaker lineage.

Init Record.

class sagemaker.lineage.context.ModelPackageGroup(sagemaker_session=None, **kwargs)

An Amazon SageMaker model package group context, which is part of a SageMaker lineage.

Init Record.

Lineage Trial Component

class sagemaker.lineage.lineage_trial_component.LineageTrialComponent(sagemaker_session=None, **kwargs)

An Amazon SageMaker, lineage trial component, which is part of a SageMaker lineage.

A trial component is a stage in a trial. Trial components are created automatically within the SageMaker runtime and also can be created directly. To automatically associate trial components with a trial and experiment supply an experiment config when creating a job. For example: https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateTrainingJob.html

trial_component_name

The name of the trial component. Generated by SageMaker from the name of the source job with a suffix specific to the type of source job. trial_component_arn (str): The ARN of the trial component.

Type

str

display_name

The name of the trial component that will appear in UI, such as SageMaker Studio.

Type

str

source

A TrialComponentSource object with a source_arn attribute.

Type

obj

status

Status of the source job.

Type

str

start_time

When the source job started.

Type

datetime

end_time

When the source job ended.

Type

datetime

creation_time

When the source job was created.

Type

datetime

created_by

Contextual info on which account created the trial component.

Type

obj

last_modified_time

When the trial component was last modified.

Type

datetime

last_modified_by

Contextual info on which account last modified the trial component.

Type

obj

parameters

Dictionary of parameters to the source job.

Type

dict

input_artifacts

Dictionary of input artifacts.

Type

dict

output_artifacts

Dictionary of output artifacts.

Type

dict

metrics

Aggregated metrics for the job.

Type

obj

parameters_to_remove

The hyperparameters to remove from the component.

Type

list

input_artifacts_to_remove

The input artifacts to remove from the component.

Type

list

output_artifacts_to_remove

The output artifacts to remove from the component.

Type

list

tags

A list of tags to associate with the trial component.

Type

List[dict[str, str]]

Init Record.

Query

class sagemaker.lineage.query.LineageEntityEnum(value)

Enum of lineage entities for use in a query filter.

class sagemaker.lineage.query.LineageSourceEnum(value)

Enum of lineage types for use in a query filter.

class sagemaker.lineage.query.LineageQueryDirectionEnum(value)

Enum of query filter directions.

class sagemaker.lineage.query.Edge(source_arn, destination_arn, association_type)

A connecting edge for a lineage graph.

Initialize Edge instance.

Parameters
  • source_arn (str) –

  • destination_arn (str) –

  • association_type (str) –

class sagemaker.lineage.query.Vertex(arn, lineage_entity, lineage_source, sagemaker_session)

A vertex for a lineage graph.

Initialize Vertex instance.

Parameters
  • arn (str) –

  • lineage_entity (str) –

  • lineage_source (str) –

class sagemaker.lineage.query.LineageQueryResult(edges=None, vertices=None)

A wrapper around the results of a lineage query.

Init for LineageQueryResult.

Parameters
  • edges (List[Edge]) – The edges of the query result.

  • vertices (List[Vertex]) – The vertices of the query result.

class sagemaker.lineage.query.LineageFilter(entities=None, sources=None, created_before=None, created_after=None, modified_before=None, modified_after=None, properties=None)

A filter used in a lineage query.

Initialize LineageFilter instance.

Parameters
class sagemaker.lineage.query.LineageQuery(sagemaker_session)

Creates an object used for performing lineage queries.

Initialize LineageQuery instance.

Visualizer

class sagemaker.lineage.visualizer.LineageTableVisualizer(sagemaker_session)

Creates a dataframe containing the lineage assoociations of a SageMaker object.

Init for LineageTableVisualizer.

Parameters

sagemaker_session (obj) – The sagemaker session used for API requests.