SageMaker ModelPackageSummary structure requires ModelPackageName even when AWS API doesn't return it #3022
Labels
bug
This issue is a confirmed bug.
service-api
This issue is caused by the service API, not the SDK implementation.
Describe the bug
In the
ModelPackageSummary
structure located https://github.com/boto/botocore/blob/develop/botocore/data/sagemaker/2017-07-24/service-2.json#L25291-L25334, theModelPackageName
is marked as a required member, however this is not the case for the SageMaker API response for model packages that are part of the SageMaker model registry. I noticed this issue when I tried to create a Stubber that returns a response for ListModelPackages: when copying the same response as returned by the AWS SageMaker ListModelPackages API to the Stubber service response, I got an unexpected validation error.I first contacted AWS via Premium support, and they informed me that this is the expected API behaviour when listing model packages in a model registry model package group, in that case the response will only include the
ModelPackageArn
as identifier, but not theModelPackageName
:Expected Behavior
ModelPackageName
member should not be required forModelPackageSummary
entities that belong to a versioned model registry model package group, as par the API response.Current Behavior
ModelPackageName
member is required in theModelPackageSummary
even for versioned model registry model package groups, which results in a validation error when copying a SageMaker API response without modification from the ListModelPackages method to a botocore Stubber that mocks the response the same ListModelPackages operation.Reproduction Steps
Possible Solution
Make the
ModelPackageName
optional or change the SageMaker API to always return the attribute regardless of whether it is from a versioned model package group or not.Additional Information/Context
No response
SDK version used
boto3==1.28.54, botocore==1.31.54
Environment details (OS name and version, etc.)
Amazon Linux release 2 (Karoo)
The text was updated successfully, but these errors were encountered: