Closed sodul closed 1 year ago
Further details.
With pip install mypy-boto3-kms==1.28.16
(previous) we have str
:
GetKeyPolicyResponseTypeDef = TypedDict(
"GetKeyPolicyResponseTypeDef",
{
"Policy": str,
"ResponseMetadata": ResponseMetadataTypeDef,
},
)
With pip install mypy-boto3-kms==1.28.36
(latest) we have:
GetKeyPolicyResponseTypeDef = TypedDict(
"GetKeyPolicyResponseTypeDef",
{
"Policy": Dict[str, Any],
"ResponseMetadata": ResponseMetadataTypeDef,
},
)
I hope this helps.
Thank you for the report.
Well, that means I have to properly check when botocore
parses strings as JSON and returns a parsed object. Until then, String shapes should always return strings. I wIll fix it today.
Released fixed packages:
mypy-boto3-acm 1.28.37
mypy-boto3-acm-pca 1.28.37
mypy-boto3-alexaforbusiness 1.28.37
mypy-boto3-chime 1.28.37
mypy-boto3-chime-sdk-identity 1.28.37
mypy-boto3-chime-sdk-messaging 1.28.37
mypy-boto3-comprehend 1.28.37
mypy-boto3-iam 1.28.37
mypy-boto3-kms 1.28.37
mypy-boto3-lookoutequipment 1.28.37
mypy-boto3-marketplace-catalog 1.28.37
mypy-boto3-mediastore 1.28.37
mypy-boto3-rekognition 1.28.37
mypy-boto3-securityhub 1.28.37
mypy-boto3-servicecatalog-appregistry 1.28.37
mypy-boto3-servicecatalog 1.28.37
mypy-boto3-sso-admin 1.28.37
mypy-boto3-sts 1.28.37
mypy-boto3-transfer 1.28.37
Please update and let me know if it works as it should.
Thank you for the fix!
Describe the bug After upgrading to from boto3 1.28.25 to 1.28.37, and the matching stubs we get an error on the types returned by KMS
get_key_policy()
.The type is
GetKeyPolicyResponseTypeDef
with a 'Policykey typed as
Dict[str, Any]`.While the policy is json encoded and that content is a dict, the type is actually
str
.I tested it and confirmed the return type:
To Reproduce Steps to reproduce the behavior:
boto3-stubs[kms]
mypy
on the following code sample:Actual output
Expected output
no error
Additional context OS: macOS 13.5.1, Python 3.11.5. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kms/client/get_key_policy.html#