Skip to content

fix(mlops): call LocalPipelineSession's pipeline methods in local mode - #6444

Open
AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/local-pipeline-session-methods
Open

AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/local-pipeline-session-methods

Conversation

@AkshayShah03

Copy link
Copy Markdown

Issue #, if available: N/A

Description of changes:

In v3 the local pipeline methods (create_pipeline, update_pipeline, describe_pipeline, delete_pipeline, start_pipeline_execution) moved from LocalSagemakerClient to sagemaker.mlops.local.LocalPipelineSession itself. local_session.py notes: "Pipeline methods have been moved to sagemaker.mlops.local.LocalPipelineSession".

Pipeline's local-mode branches still call them on sagemaker_session.sagemaker_client. So with a LocalPipelineSession:

  • create(), upsert(), update() and start() always fail with AttributeError: 'LocalSagemakerClient' object has no attribute 'create_pipeline';
  • describe() and delete() go to the real client.

This change calls the session's own methods in local mode.

One related issue isn't addressed here: the mlops LocalPipelineSession subclasses LocalSession but not PipelineSession, so step arguments aren't captured under it the way they are under the core LocalPipelineSession. That's a larger change.

Testing:

  • New test_pipeline_api_in_local_mode runs create, upsert, update, describe, start and delete against a real LocalPipelineSession with a FailStep pipeline; the execution ends Failed as designed. It fails before this change.
  • The existing local-mode unit tests in test_pipeline.py and test_pipeline_class.py asserted the client calls. They now assert the session calls.
  • sagemaker-mlops/tests/unit: 833 passed. The 28 feature_processor collection errors also happen on master.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

In v3 the local pipeline methods (create_pipeline, update_pipeline,
describe_pipeline, delete_pipeline, start_pipeline_execution) moved from
LocalSagemakerClient to sagemaker.mlops.local.LocalPipelineSession, but
Pipeline's local-mode branches still called them on
sagemaker_session.sagemaker_client. Pipeline.create(), upsert(), update()
and start() with a LocalPipelineSession therefore always failed with
AttributeError: 'LocalSagemakerClient' object has no attribute
'create_pipeline' (describe() and delete() hit the real client).

Call the session's methods in local mode. The new test runs the Pipeline
API against a real LocalPipelineSession; the existing local-mode unit tests
asserted the client calls and now assert the session calls.

This branch is waiting to be deployed

1 waiting deployment
manual-approval — 26d2608d Waiting Oct 12, 2026 by AkshayShah03 via wait-for-approval #1998
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.

1 participant