Firehose: interpolate the destination id in the not-found message - #10139
Open
Zuhef wants to merge 1 commit into
Open
Firehose: interpolate the destination id in the not-found message#10139Zuhef wants to merge 1 commit into
Zuhef wants to merge 1 commit into
Conversation
update_destination raised InvalidArgumentException with a missing f prefix, so callers saw the literal text {destination_id} instead of the id they passed.
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.
update_destination()reports an unknown destination id with a missingfprefix, so the caller gets the placeholder text rather than the id they passed:The
raiseimmediately above it in the same method uses f-strings, and every other braced string inmoto/firehose/models.pyis an f-string, so this looks like a slip rather than an intentional literal.Added the unknown-id case to
test_update_destination, which previously only ever passed the id that exists. Without the one-character change it fails with:tests/test_firehosepasses (31), andruff formatis clean.ruff check moto/firehose tests/test_firehosereports the same 5 findings before and after my change, and the one mypy finding in this file (models.py:443) is also present on an unmodified checkout, so I have left both alone.One thing I did not verify: the exact wording real Firehose uses for this error. I only changed the interpolation, not the text, so if AWS words it differently that is a separate question.