You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LocalPipelineSession Mutates sagemaker_client by Injecting _pipelines Attribute #5604
This modifies the client instance by attaching internal state that is unrelated to the client’s intended responsibility.
Because sagemaker_client is typically expected to behave like a boto-style service client, mutating it in this way introduces hidden state and side effects.
Why this is problematic
This approach can cause several issues:
Breaks encapsulation
Pipeline state is stored on the service client rather than on the session or pipeline objects that own the state.
Unexpected side effects
If multiple LocalPipelineSession instances share the same client object, they will also share the same _pipelines registry.
Potential attribute collision _pipelines could conflict with future attributes added to the client implementation.
Harder debugging and maintenance
Attaching internal state to an external object makes the code harder to reason about and maintain.
In general, AWS SDK components avoid mutating externally provided clients and instead maintain internal state within the session or service wrapper.
To reproduce
Example demonstrating shared pipeline state when using the same client object:
fromsagemaker.workflow.pipeline_contextimportLocalPipelineSessionsession1=LocalPipelineSession()
session2=LocalPipelineSession()
client=session1.sagemaker_client# session2 reuses the same clientsession2.sagemaker_client=clientsession1.sagemaker_client._pipelines["pipelineA"] ="A"print(session2.sagemaker_client._pipelines)
Output:
{'pipelineA': 'A'}
Both sessions share the same _pipelines state because it was attached to the client object.
Expected behavior
Pipeline state should be owned by the session or pipeline classes, not by the sagemaker_client.
A safer design would store pipelines inside the session instance:
Fixed by #6317 (merged 2026-10-08), released in v3.25.0. LocalPipelineSession no longer injects a _pipelines attribute onto sagemaker_client; pipeline state lives on the session-owned registry instead. Upgrade with pip install -U sagemaker. If you still see this on v3.25.0 or later, please reopen with a repro.
Activity
sandbox: iteration 1 for issue #5604
fix(local): Align local mode with the SageMaker service
fix(local): Align local mode with the SageMaker service
jam-jee commentedon Oct 14, 2026
Fixed by #6317 (merged 2026-10-08), released in v3.25.0.
LocalPipelineSessionno longer injects a_pipelinesattribute ontosagemaker_client; pipeline state lives on the session-owned registry instead. Upgrade withpip install -U sagemaker. If you still see this on v3.25.0 or later, please reopen with a repro.Mattral commentedon Oct 15, 2026
Thank you for following up!