Skip to content

fix: Transformer tags pydantic validation and shape compatibility#6103

Open
wasim-builds wants to merge 4 commits into
aws:masterfrom
wasim-builds:fix/issue-6090-transformer-tags
Open

fix: Transformer tags pydantic validation and shape compatibility#6103
wasim-builds wants to merge 4 commits into
aws:masterfrom
wasim-builds:fix/issue-6090-transformer-tags

Conversation

@wasim-builds

Copy link
Copy Markdown

Fixes #6090.

This PR fixes two issues with how tags are handled in Transformer.transform() in sagemaker-core:

  1. It pops tags and Tags from the transformed dictionary before constructing the sagemaker.core.resources.TransformJob object. TransformJob does not expect or allow extra fields, so this prevents a pydantic.ValidationError (extra_forbidden).
  2. It correctly formats tags and ensures capitalization (to Key and Value) before passing them in the CreateTransformJob API request. This prevents incompatibility when tags are passed in a format like [{"key": "foo", "value": "bar"}], which ModelTrainer accepts but backend APIs reject as invalid shape.

@wasim-builds

Copy link
Copy Markdown
Author

By the way, I've really been enjoying contributing to this project! My goal is to get more involved in open source to help maintain projects and learn from great engineering teams. Is there a process or pathway for becoming a member of the aws GitHub organization? I'd love to continue helping out where I can!

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.

Transformer.transform() raises pydantic ValidationError ("tags: extra_forbidden") after submitting the job when tags are set

1 participant