Closed skeggse closed 1 year ago
Thank you for the report!
Yes, looks like an issue in botocore
shapes, because as I see boto3
does not override this type and returns original botocore
response.
"policyDocumentType":{
"type":"string",
"max":131072,
"min":1,
"pattern":"[\\u0009\\u000A\\u000D\\u0020-\\u00FF]+"
},
I created a bug report for botocore
: https://github.com/boto/botocore/issues/2992
I added a temporary fix and released mypy-boto3-iam 1.28.16
. Please update and let me know if it works as it should.
Describe the bug
The
get_policy_version
function returns a valuev
withtype(v["Policy"]["Document"]) == dict
, rather than thestr
claimed by the types provided byboto3-stubs[iam]
.What's interesting about this issue is that the official documentation for
boto3
indicates that theDocument
value ought to be astr
, but it's not.To Reproduce
Steps to reproduce the behavior:
boto3-stubs[iam]
pyright
on the above code sampleActual output
Yet we demonstrated in the earlier script that this is a
dict
! And from testing, this is consistent for both AWS-managed policies and customer-managed policies.Expected output
Additional context
macOS,
pip