Skip to content

fix(parameters): clarify errors for missing DynamoDB and AppConfig data - #8618

Merged
leandrodamascena merged 2 commits into
aws-powertools:developfrom
kudala-bharani:fix/parameter-missing-data-errors
Oct 29, 2026
Merged

leandrodamascena merged 2 commits into
aws-powertools:developfrom
kudala-bharani:fix/parameter-missing-data-errors

Conversation

@kudala-bharani

Copy link
Copy Markdown
Contributor

Issue number: closes #8601

Summary

Changes

Add descriptive GetParameterError messages when a DynamoDB item is missing, a query result lacks the configured sort attribute, or AppConfig returns an empty initial configuration with no previous value to reuse.

Five regression cases cover these errors, custom sort attributes, recovery after an empty first response, and reuse of the previous AppConfig value on later empty responses.

User experience

Instead of errors like 'Item', 'sk', or the configuration name alone, callers get the missing parameter/attribute and its table, or the configuration's application and environment. Normal retrieval and caching behavior are unchanged.

Testing

  • Parameters functional suite: 143 passed on Python 3.13.
  • Formatting, lint, mypy, security/complexity baselines, and commit hooks passed.
  • Unit + functional suite: 3,600 passed, 72 skipped, 1 failed. The Datadog test_datadog_write_to_log_with_env_variable failure also occurs on untouched develop at bdd370b (3,595 passed, 72 skipped, same failure); it passes in isolation.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kudala-bharani
kudala-bharani requested a review from a team as a code owner October 18, 2026 17:35
@kudala-bharani
kudala-bharani requested a review from svozza October 18, 2026 17:35
@boring-cyborg

boring-cyborg Bot commented Oct 18, 2026

Copy link
Copy Markdown

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@boring-cyborg boring-cyborg Bot added the tests label Oct 18, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 18, 2026
@leandrodamascena leandrodamascena added this to the 3.39.0 milestone Oct 19, 2026

@leandrodamascena leandrodamascena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kudala-bharani, this is a real improvement. I ran it against a real DynamoDB table and the messages now name the parameter, the table and the misconfigured sort attribute, which is exactly what someone debugging a provider setup needs. On the AppConfig side I could not make the service return an empty configuration on a first call, a profile that was never deployed fails earlier with Deployment not found, so that branch is a safety net rather than a fix. That is on my issue, not on you.

One small ask while you are here: an item that exists but lacks the value_attr still raises the bare 'value'. Same shape of bug as the other two, one more check in _get and a test would close it.

Approving now anyway. This goes out in 3.39.0, so there is time for that tweak before I merge. No rebase needed, and you'll be credited in the release notes.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.95%. Comparing base (fe256cf) to head (8f67781).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8618   +/-   ##
========================================
  Coverage    96.95%   96.95%           
========================================
  Files          321      321           
  Lines        16251    16260    +9     
  Branches      1453     1456    +3     
========================================
+ Hits         15756    15765    +9     
  Misses         353      353           
  Partials       142      142           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena
leandrodamascena merged commit 7188793 into aws-powertools:develop Oct 29, 2026
13 of 14 checks passed
@boring-cyborg

boring-cyborg Bot commented Oct 29, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@powertools-for-aws-oss-automation

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: DynamoDBProvider and AppConfigProvider surface bare KeyError text as the error message

2 participants