Skip to content

fix(parameters): honor auto transform in batched get_parameters_by_name - #8436

Open
MohammedAlkindi wants to merge 1 commit into
aws-powertools:developfrom
MohammedAlkindi:fix/ssm-get-parameters-by-name-auto-transform-key
Open

fix(parameters): honor auto transform in batched get_parameters_by_name#8436
MohammedAlkindi wants to merge 1 commit into
aws-powertools:developfrom
MohammedAlkindi:fix/ssm-get-parameters-by-name-auto-transform-key

Conversation

@MohammedAlkindi

Copy link
Copy Markdown

Issue number: closes #8435

transform="auto" infers the transform from the parameter name suffix, but _transform_and_cache_get_parameters_response called transform_value() without key=name. The batched GetParameters path therefore inferred from an empty string and fell back to the identity transform, returning raw strings with nothing raised. Parameters routed through BaseProvider.get() (decrypt=True) already pass the key, so a single get_parameters_by_name call could return a parsed dict for some names and a raw string for others. #7083 fixed the argument-order bug in this function and covered transform="json"; auto was not covered by that test. This was the only transform_value() call site omitting the key: BaseProvider.get() and secrets.py pass it, and get_multiple() transforms a dict keyed per item.

Fail-before, source reverted and the new test kept: 1 failed, the assertion showing the raw JSON string against the expected dict. Pass-after: 1 passed. tests/functional/parameters/: 125 passed. ruff format --check and ruff check: clean.

Not run here: make mypy, make ty, and the e2e suite.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

transform="auto" infers the transform method from the parameter name suffix, but _transform_and_cache_get_parameters_response called transform_value() without key=name. The batched GetParameters path therefore inferred from an empty string and silently fell back to the identity transform, returning raw strings instead of parsed values.

Parameters routed to the single GetParameter path (decrypt=True) already pass the key via BaseProvider.get(), so a single get_parameters_by_name call could return a parsed dict for some parameters and a raw string for others.
@MohammedAlkindi
MohammedAlkindi requested a review from a team as a code owner September 4, 2026 15:45
@boring-cyborg

boring-cyborg Bot commented Sep 4, 2026

Copy link
Copy Markdown

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@boring-cyborg boring-cyborg Bot added the tests label Sep 4, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: get_parameters_by_name ignores transform="auto" for batched parameters

1 participant