Skip to content

fix(core): read container image from the Model resource in Transformer - #6418

Open
AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/transformer-retrieve-image-uri
Open

AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/transformer-retrieve-image-uri

Conversation

@AkshayShah03

Copy link
Copy Markdown

Issue #, if available: N/A

Description of changes:

Transformer._retrieve_image_uri calls getattr on model.__dict__, which is a plain dict:

model_desc = model.__dict__
primary_container = getattr(model_desc, "primary_container", None)  # always None

getattr on a dict always returns the default, so the method always returns None. Auto-generated transform job names therefore always fall back to the model name instead of the image's algorithm name.

This change reads primary_container and containers from the Model resource itself.

Testing:

  • The two _retrieve_image_uri tests replaced __dict__ with a dict subclass that supports attribute access, which hid the bug.
  • They now use real Model / ContainerDefinition objects and fail before this change.
  • tests/unit/test_transformer.py: 30 passed.

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

Transformer._retrieve_image_uri called getattr() on model.__dict__, a plain
dict, so it always got the default and returned None. Auto-generated
transform job names therefore always fell back to the model name instead of
the image's algorithm name.

Read primary_container/containers from the Model resource itself. The unit
tests used a dict subclass with attribute access as __dict__, which hid the
bug; they now use real Model/ContainerDefinition objects.

This branch had an error being deployed

1 failed deployment
manual-approval — 31b1bfaf Deployed Oct 10, 2026 by AkshayShah03 via wait-for-approval #600
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