fix: Invalid import (5637) by aviruthen · Pull Request #5723 · aws/sagemaker-python-sdk

Description

The issue is an invalid import on line 208 of sagemaker-mlops/src/sagemaker/mlops/workflow/steps.py. The DelayedReturn class is defined in sagemaker.mlops.workflow.function_step, but the import incorrectly references sagemaker.core.workflow.function_step, which does not exist. This is a lazy import inside _find_dependencies_in_step_arguments(). The module sagemaker.core.workflow.function_step doesn't exist — DelayedReturn lives in the mlops package at sagemaker.mlops.workflow.function_step. Other files in the codebase (e.g., sagemaker-mlops/src/sagemaker/mlops/local/pipeline.py, sagemaker-core/src/sagemaker/core/remote_function/core/pipeline_variables.py) correctly import from sagemaker.mlops.workflow.function_step. The test file also has mock patches referencing the wrong module path.

Related Issue

Related issue: 5637

Changes Made

  • sagemaker-mlops/src/sagemaker/mlops/workflow/steps.py
  • sagemaker-mlops/tests/unit/workflow/test_steps.py

AI-Generated PR

This PR was automatically generated by the PySDK Issue Agent.

  • Confidence score: 85%
  • Classification: bug
  • SDK version target: V3

Merge Checklist

  • Changes are backward compatible
  • Commit message follows prefix: description format
  • Unit tests added/updated
  • Integration tests added (if applicable)
  • Documentation updated (if applicable)