aws_cdk.assertions.Annotations.find_error: Instead of emitting none, shows KeyError: 'aws-cdk-lib.cloud_assembly_schema.MetadataEntry
#33211
Labels
@aws-cdk/assertions
Related to the @aws-cdk/assertv2 package
bug
This issue is a bug.
p3
potential-regression
Marking this issue as a potential regression to be checked by team member
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
In previous versions of CDK, aws_cdk.assertions.Annotations.from_stack worked, in newer versions of CDK it is broken (in Python 3.12)
Calls to Annotations similar to
Now, the
find_error
raises:I suspect that this is broken after #32998 since this is a relatively recent change impacting
MetadataEntry
.Running the
find_error
on a message that does not exist succeeds (returns an empty array). It is interesting thathas_error
works correctly, butfind_error
appears to be broken.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
I expect both
find_error
andhas_error
to work correctly.Current Behavior
find_error
now raises a KeyError related to MetadataEntry, see aboveReproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.177.0
Framework Version
aws-cdk-lib 2.177.0
Node.js Version
v20.18.1
OS
Darwin DYFXL2QQK9 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 arm64
Language
Python
Language Version
3.12
Other information
No response
The text was updated successfully, but these errors were encountered: