fix: Pipeline.upsert() TypeError (real agent 1773873366) (#66666)#6
Closed
fix: Pipeline.upsert() TypeError (real agent 1773873366) (#66666)#6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Pipeline.create(), update(), upsert(), and put_triggers() methods accept role_arn typed as str but never validate its type. When a non-string value like a dict is passed, it propagates to the boto3 API call and raises an unhelpful TypeError. The fix is to add a _validate_role_arn() helper that checks isinstance(role_arn, str) after config resolution (but before the None check), and raises a clear ValueError with the parameter name and actual type. This validation should be added in all four methods after resolve_value_from_config() returns but before the existing 'not role_arn' check.
Related Issue
Fixes #66666
Changes Made
src/sagemaker/workflow/pipeline.pytests/unit/sagemaker/workflow/test_pipeline.pyAI-Generated PR
This PR was automatically generated by the PySDK Issue Agent.
Merge Checklist
prefix: descriptionformat