AWS Security ChangesHomeSearch

AWS sagemaker documentation change

Service: sagemaker · 2026-07-01 · Documentation low

File: sagemaker/latest/dg/pipelines-step-decorator-create-pipeline.md

Summary

Removed legacy SageMaker Python SDK v2 code examples and retained only v3 examples throughout the documentation

Security assessment

The changes involve removing outdated code samples without introducing new security content or addressing vulnerabilities. No security-related terms or vulnerability references are present in the diff.

Diff

diff --git a/sagemaker/latest/dg/pipelines-step-decorator-create-pipeline.md b/sagemaker/latest/dg/pipelines-step-decorator-create-pipeline.md
index 650e103e9..30587955c 100644
--- a//sagemaker/latest/dg/pipelines-step-decorator-create-pipeline.md
+++ b//sagemaker/latest/dg/pipelines-step-decorator-create-pipeline.md
@@ -32,3 +31,0 @@ To create a step using the `@step` decorator, annotate the function with `@step`
-SageMaker Python SDK v3
-    
-    
@@ -46,14 +42,0 @@ SageMaker Python SDK v3
-SageMaker Python SDK v2 (Legacy)
-    
-    
-    
-    from sagemaker.workflow.function_step import step
-    
-    @step
-    def preprocess(raw_data):
-        df = pandas.read_csv(raw_data)
-        ...
-        return procesed_dataframe
-        
-    step_process_result = preprocess(raw_data)
-
@@ -70,3 +52,0 @@ Passing in the `DelayedReturn` output of one function as an input to another fun
-SageMaker Python SDK v3
-    
-    
@@ -91,21 +70,0 @@ SageMaker Python SDK v3
-SageMaker Python SDK v2 (Legacy)
-    
-    
-    
-    from sagemaker.workflow.function_step import step
-    
-    @step
-    def preprocess(raw_data):
-        df = pandas.read_csv(raw_data)
-        ...
-        return procesed_dataframe
-    
-    @step
-    def train(training_data):
-        ...
-        return trained_model
-    
-    step_process_result = preprocess(raw_data)    
-    step_train_result = train(step_process_result)
-    
-
@@ -120,3 +78,0 @@ In the previous example, the `train` function received the `DelayedReturn` outpu
-SageMaker Python SDK v3
-    
-    
@@ -145,25 +100,0 @@ SageMaker Python SDK v3
-SageMaker Python SDK v2 (Legacy)
-    
-    
-    
-    from sagemaker.workflow.step_outputs import get_step
-    
-    @step
-    def preprocess(raw_data):
-        df = pandas.read_csv(raw_data)
-        ...
-        processed_data = ..
-        return s3.upload(processed_data)
-    
-    @step
-    def train():
-        training_data = s3.download(....)
-        ...
-        return trained_model
-    
-    step_process_result = preprocess(raw_data)    
-    step_train_result = train()
-    
-    get_step(step_train_result).add_depends_on([step_process_result])
-    
-
@@ -174,3 +104,0 @@ You can create a pipeline that includes a `@step`-decorated step and a tradition
-SageMaker Python SDK v3
-    
-    
@@ -205,31 +132,0 @@ SageMaker Python SDK v3
-SageMaker Python SDK v2 (Legacy)
-    
-    
-    
-    # Define processing step
-    
-    from sagemaker.sklearn.processing import SKLearnProcessor
-    from sagemaker.processing import ProcessingInput, ProcessingOutput
-    from sagemaker.workflow.steps import ProcessingStep
-    
-    sklearn_processor = SKLearnProcessor(
-        framework_version='1.2-1',
-        role='arn:aws:iam::123456789012:role/SagemakerExecutionRole',
-        instance_type='ml.m5.large',
-        instance_count='1',
-    )
-    
-    inputs = [
-        ProcessingInput(source=input_data, destination="/opt/ml/processing/input"),
-    ]
-    outputs = [
-        ProcessingOutput(output_name="train", source="/opt/ml/processing/train"),
-        ProcessingOutput(output_name="validation", source="/opt/ml/processing/validation"),
-        ProcessingOutput(output_name="test", source="/opt/ml/processing/test")
-    ]
-    
-    process_step = ProcessingStep(
-        name="MyProcessStep",
-        step_args=sklearn_processor.run(inputs=inputs, outputs=outputs,code='preprocessing.py'),
-    )
-    
@@ -269,3 +165,0 @@ Pipelines supports a `ConditionStep` class which evaluates the results of preced
-SageMaker Python SDK v3
-    
-    
@@ -292,23 +185,0 @@ SageMaker Python SDK v3
-SageMaker Python SDK v2 (Legacy)
-    
-    
-    
-    # Define ConditionStep
-    
-    from sagemaker.workflow.condition_step import ConditionStep
-    from sagemaker.workflow.conditions import ConditionGreaterThanOrEqualTo
-    from sagemaker.workflow.fail_step import FailStep
-    
-    conditionally_register = ConditionStep(
-        name="conditional_register",
-        conditions=[
-            ConditionGreaterThanOrEqualTo(
-                # Output of the evaluate step must be json serializable
-                left=evaluate_model()["rmse"],  # 
-                right=5,
-            )
-        ],
-        if_steps=[FailStep(name="Fail", error_message="Model performance is not good enough")],
-        else_steps=[register_model()],
-    )
-
@@ -319,3 +189,0 @@ You define a pipeline the same way whether or not you use a `@step` decorator. W
-SageMaker Python SDK v3
-    
-    
@@ -331,12 +198,0 @@ SageMaker Python SDK v3
-SageMaker Python SDK v2 (Legacy)
-    
-    
-    
-    from sagemaker.workflow.pipeline import Pipeline
-    
-    pipeline = Pipeline(
-        name="<pipeline-name>",
-        steps=[step_train_result],
-        sagemaker_session=<sagemaker-session>,
-    )
-