You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: DynamoDBProvider and AppConfigProvider surface bare KeyError text as the error message #8601
Error messages explain what went wrong: for example Parameter 'nope' not found in table 't'.
Current Behaviour
Three places let a KeyError propagate and GetParameterError ends up with the raw key as its message: dynamodb.py:205 ('Item' when the item does not exist), dynamodb.py:233 ('sk' when an item lacks the sort attribute), appconfig.py:148 ('cfg' when the first get_latest_configuration returns an empty Configuration, for example a profile never deployed).
Code snippet
frombotocore.configimportConfigfrombotocore.stubimportStubberfromaws_lambda_powertools.utilities.parametersimportDynamoDBProviderprovider=DynamoDBProvider(table_name="t", config=Config(region_name="us-east-1"))
stub=Stubber(provider.table.meta.client)
stub.add_response("get_item", {}, None)
stub.activate()
provider.get("nope") # GetParameterError: 'Item' expected a message that names the parameter and table
Possible Solution
Check for the missing keys explicitly and raise GetParameterError with a descriptive message in the three places.
Steps to Reproduce
Run the snippet above (it uses botocore.stub.Stubber, no AWS access needed).
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.13
Packaging format used
PyPi
Debugging logs
Warning
This issue is ready to be picked up, by humans or by agents. If you want it, comment here first so we can assign it to you, and please take only one or two issues at a time so others can join in too. The reproduction above runs locally without AWS access. Thanks!
Activity
kudala-bharani commentedon Oct 18, 2026
Could I take this one? I'll add descriptive errors for the three missing-data cases and regression tests that run without AWS access.
leandrodamascena commentedon Oct 18, 2026
Pls go ahead @kudala-bharani