Skip to content

Firehose: interpolate the destination id in the not-found message - #10139

Open
Zuhef wants to merge 1 commit into
getmoto:masterfrom
Zuhef:fix/alpha-firehose-destination-id-message
Open

Firehose: interpolate the destination id in the not-found message#10139
Zuhef wants to merge 1 commit into
getmoto:masterfrom
Zuhef:fix/alpha-firehose-destination-id-message

Conversation

@Zuhef

@Zuhef Zuhef commented Jul 30, 2026

Copy link
Copy Markdown

update_destination() reports an unknown destination id with a missing f prefix, so the caller gets the placeholder text rather than the id they passed:

>>> client.update_destination(
...     DeliveryStreamName="my-stream",
...     CurrentDeliveryStreamVersionId="1",
...     DestinationId="destinationId-000000000009",
...     ExtendedS3DestinationUpdate=s3_config,
... )
InvalidArgumentException: Destination Id {destination_id} not found

The raise immediately above it in the same method uses f-strings, and every other braced string in moto/firehose/models.py is 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:

assert 'Destination Id destinationId-000000000009 not found' in 'Destination Id {destination_id} not found'

tests/test_firehose passes (31), and ruff format is clean. ruff check moto/firehose tests/test_firehose reports 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.

update_destination raised InvalidArgumentException with a missing f prefix, so callers saw the literal text {destination_id} instead of the id they passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant