Repository navigation
Conversation
…y_name _get_parameters_by_name only handled InvalidKeyId and InternalServerError, so throttling or any other ClientError escaped raw in both modes. And in fail-fast mode, those two handled errors returned failed names that the caller discarded, so parameters silently went missing. Any failure of the GetParameters request now raises GetParameterError when raise_on_error=True, and reports the request's names under _errors when raise_on_error=False. Closes aws-powertools#8597 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the conflict with aws-powertools#8616 in _get_parameters_by_name: keep the broader `except Exception` from this branch and aws-powertools#8616's "Failed to fetch parameters: [...]" message, with the botocore error appended so both sets of tests hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issue number: closes #8597
Summary
Changes
_get_parameters_by_namenow catches any exception from theGetParametersrequest. Withraise_on_error=Trueit raisesGetParameterError(chained withfrom exc, so the botocore error is available as__cause__). Withraise_on_error=Falseit returns the request's names, which end up under_errors.InvalidKeyIdandInternalServerErrorwere caught, so throttling or any otherClientErrorescaped raw in both modes.InvalidKeyIdandInternalServerErrorraiseGetParameterErrorin fail-fast mode. This PR keeps itsFailed to fetch parameters: [...]message and appends the botocore error, so the cause is visible without reading__cause__.InvalidParametersare unchanged; only request-level failures are affected.GetParametersrequestget_parameters_by_namemakes: all-decrypt batches, non-decrypt batches, and the non-decrypted subset of a mixed batch. The decrypted subset of a mixed batch goes throughget(), which already wraps errors.Tests added in
tests/functional/parameters/_boto3/test_utilities_parameters.py:ThrottlingException,InvalidKeyIdandInternalServerError, each withdecrypt=Falseanddecrypt=True, assertingGetParameterErrorand the exactNames/WithDecryptionsent.InvalidParametersentry and the second throttled. Asserts_errors == [invalid, throttled]and that the successful values are kept.On current
develop, the throttling cases and the graceful test fail because theClientErrorescapes. TheInvalidKeyIdandInternalServerErrorcases already raise there since #8616 and fail only because the message doesn't name the error code. With this change,pytest tests/functional/parameters→ 190 passed.User experience
Before:
After:
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.
🤖 Generated with Claude Code