Closed Wurstnase closed 1 year ago
Same issue seen with S3 for multiple TypedDicts, specifically CORSRuleTypeDef
, ServerSideEncryptionByDefaultTypeDef
, ServerSideEncryptionRuleTypeDef
, LifecycleRuleTypeDef
, LoggingEnabledTypeDef
, TopicConfigurationTypeDef
, MetricsConfigurationTypeDef
.
Thank you for the report!
Looks like the issue is related to a new logic for marking output TypedDict
shapes as total. However, some shapes are used both as input and output. The proper fix would be to generate two TypedDicts
(e.g. RotationRulesTypeTypeDef
and RotationRulesTypeOutputTypeDef
).
I will take a look.
Fixed in mypy_boto3_builder 7.14.7
release. Please let me know if it works as it should.
All output TypeDefs
now have postfix OutputTypeDef
. The corresponding input TypeDef
uses totality from the underlying Shape
. OutputTypeDef
is always total=True
. If you use type annotations explicitly in your code, some rewrite may be required: change ...TypeDef
to ...OutputTypeDef
if it no longer exists.
I also published new packages with the hotfix included:
mypy-boto3-cognito-idp 1.28.3.post1
mypy-boto3-connect 1.28.3.post1
mypy-boto3-datasync 1.28.3.post1
mypy-boto3-dms 1.28.3.post1
mypy-boto3-ec2 1.28.3.post1
mypy-boto3-fsx 1.28.3.post1
mypy-boto3-iam 1.28.3.post1
mypy-boto3-mediatailor 1.28.3.post1
mypy-boto3-personalize 1.28.3.post1
mypy-boto3-proton 1.28.3.post1
mypy-boto3-s3 1.28.3.post1
mypy-boto3-sagemaker 1.28.3.post1
mypy-boto3-secretsmanager 1.28.3.post1
mypy-boto3 1.28.3.post1
boto3-stubs 1.28.3.post1
boto3-stubs-lite 1.28.3.post1
@vemel
If you guys are pushing breaking changes like this could we yank it and increment the major version please?
The post1
is a breaking change for us. I started getting this error after the post1 version has been pushed.
from mypy_boto3_ec2.type_defs import SubnetTypeDef
ImportError: cannot import name 'SubnetTypeDef' from 'mypy_boto3_ec2.type_defs'
@ecs-jnguyen Makes sense. I came up with a non-conflicting solution. I will release it in a few hours. Also, I am going to release post2
to affected packages.
@ecs-jnguyen Just released mypy-boto3-ec2 1.28.3.post2
with the fix included. Please test it and let me know if it works as it should.
Also, many other packages were updated, check 7.15.0 release notes.
LGTM. Thanks for your fast response and fixes.
Describe the bug Some
TypeDict
s are nottotal=False
anymore. Withmypy-boto3-secretsmanger==1.28.3
the flag is gone in the TypeDef.To Reproduce Steps to reproduce the behavior:
mypy-boto3-secretsmanger==1.28.3
mypy
/pyright
on the following code sampleActual output
Expected output