Python: Fix type annotations in KMS client methods#7520
Merged
brmur merged 5 commits intoawsdocs:mainfrom Aug 5, 2025
Merged
Conversation
`kms_client.encrypt` returns type `bytes`. Updated method signatures for encrypt and decrypt. The "Plaintext" returned from `kms_client.decrypt` is also `bytes`, but it should be decoded to `str` to match the parameter type of the encrypt method.
tejasgn1
reviewed
Jul 25, 2025
tejasgn1
requested changes
Jul 25, 2025
Contributor
tejasgn1
left a comment
There was a problem hiding this comment.
Hi, we don't need use the decode() method here as that is being taken care of on line 201. Having the method returns an error. The other changes look good to me.
I removed the redundant call to decode() on line 201. The call to decode() should be inside the decrypt() function, making its signature the inverse of encrypt(). Since encode() is called from encrypt(), it makes sense that decode() would be called in decrypt().
Contributor
Author
|
@tejasgn1 could you please resolve the requested changes. |
tejasgn1
approved these changes
Aug 1, 2025
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.
Updated encrypt/decrypt method signatures to properly handle bytes return types from KMS client operations.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.