Skip to content

fix: Invalid import (5637)#5723

Open
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/invalid-import-5637-3
Open

fix: Invalid import (5637)#5723
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/invalid-import-5637-3

Conversation

@aviruthen
Copy link
Copy Markdown
Collaborator

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)

Copy link
Copy Markdown
Collaborator

@sagemaker-bot sagemaker-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Code Review

This PR correctly fixes an invalid import path for DelayedReturn in sagemaker-mlops/src/sagemaker/mlops/workflow/steps.py, changing it from the non-existent sagemaker.core.workflow.function_step to the correct sagemaker.mlops.workflow.function_step. The corresponding test mocks are also updated to match. The fix is straightforward, correct, and backward compatible.

✅ No issues found — looks good!

@aviruthen aviruthen marked this pull request as ready for review April 7, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants