@@ -409,7 +409,7 @@ def test_step_find_dependencies_in_step_arguments_with_json_get():
409409 obj = {"key" : json_get }
410410
411411 with patch ('sagemaker.mlops.workflow.steps.TYPE_CHECKING' , False ):
412- with patch .dict ('sys.modules' , {'sagemaker.core .workflow.function_step' : Mock ()}):
412+ with patch .dict ('sys.modules' , {'sagemaker.mlops .workflow.function_step' : Mock ()}):
413413 dependencies = Step ._find_dependencies_in_step_arguments (step2 , obj , {"step1" : step1 })
414414 assert "step1" in dependencies
415415
@@ -445,7 +445,7 @@ def test_step_find_dependencies_in_step_arguments_with_delayed_return():
445445 mock_module = Mock ()
446446 mock_module .DelayedReturn = delayed_return_class
447447
448- with patch .dict ('sys.modules' , {'sagemaker.core .workflow.function_step' : mock_module }):
448+ with patch .dict ('sys.modules' , {'sagemaker.mlops .workflow.function_step' : mock_module }):
449449 dependencies = Step ._find_dependencies_in_step_arguments (step2 , obj , {"step1" : step1 })
450450 assert "step1" in dependencies
451451
@@ -473,11 +473,18 @@ def test_step_find_dependencies_in_step_arguments_with_string_reference():
473473 mock_module = Mock ()
474474 mock_module .DelayedReturn = delayed_return_class
475475
476- with patch .dict ('sys.modules' , {'sagemaker.core .workflow.function_step' : mock_module }):
476+ with patch .dict ('sys.modules' , {'sagemaker.mlops .workflow.function_step' : mock_module }):
477477 dependencies = Step ._find_dependencies_in_step_arguments (step2 , obj , step_map )
478478 assert "step1" in dependencies
479479
480480
481+ def test_delayed_return_import_from_correct_module ():
482+ """Verify that DelayedReturn can be imported from sagemaker.mlops.workflow.function_step."""
483+ from sagemaker .mlops .workflow .function_step import DelayedReturn
484+ assert DelayedReturn is not None
485+ assert hasattr (DelayedReturn , '_to_json_get' )
486+
487+
481488def test_tuning_step_requires_step_args ():
482489 from sagemaker .mlops .workflow .steps import TuningStep
483490
0 commit comments