Repository navigation
fix(parameters): handle transform failures gracefully in get_parameters_by_name - #8623
Conversation
|
Hi, I accidentally removed my assignment from this PR and now GitHub doesn't show me an option to assign myself again. I'm still actively interested in maintaining this contribution. Could a maintainer please reassign me (@Suraj1347) to PR #8623? Thank you! |
leandrodamascena
left a comment
There was a problem hiding this comment.
Thanks @Suraj1347, this is the right fix on both paths. I ran it against real Parameter Store with a SecureString and a String holding invalid JSON next to a valid one and a literal null: in graceful mode both failures now land in _errors, the good values come back, the null is returned as None without being counted as a failure, and nothing bad is cached, so a corrected parameter is picked up on the next call. Fail-fast still raises.
Approving. One note for the release notes, not for you: a failed transform is now omitted from the result instead of coming back as None, which is consistent with fetch failures but visible to anyone who checked for None.
This goes out in 3.39.0, so it will sit here for a while before I merge it. No rebase needed in the meantime, and you'll be credited in the release notes.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8623 +/- ##
===========================================
+ Coverage 96.95% 96.97% +0.01%
===========================================
Files 321 321
Lines 16258 16266 +8
Branches 1455 1456 +1
===========================================
+ Hits 15763 15774 +11
+ Misses 353 352 -1
+ Partials 142 140 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ede714e
into
aws-powertools:develop
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |



Issue
Closes #8594
Summary
When raise_on_error=False, parameter transformation failures in get_parameters_by_name should be reported gracefully instead of unexpectedly raising an exception or caching a failed result.
Changes
Handle TransformParameterError in the decrypt and batch retrieval paths when graceful error handling is requested.
Record failed parameter names in _errors.
Omit failed batch transformations from the returned mapping and avoid caching failed results.
Preserve fail-fast behavior when raise_on_error=True.
Correctly handle valid JSON null values without treating them as transformation failures.
Tests and verification
Targeted get_parameters_by_name tests: 22 passed.
Full test_utilities_parameters.py: 130 passed.
Ruff check: passed.
Ruff format check: passed.
These checks were run locally. GitHub CI and maintainer review remain pending.
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.