Skip to content

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

Merged
leandrodamascena merged 5 commits into
aws-powertools:developfrom
MohammedAlkindi:fix/ssm-get-parameters-by-name-auto-transform-key
Sep 14, 2026
Merged

leandrodamascena merged 5 commits into
aws-powertools:developfrom
MohammedAlkindi:fix/ssm-get-parameters-by-name-auto-transform-key

Conversation

@MohammedAlkindi

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

@leandrodamascena leandrodamascena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @MohammedAlkindi! Approved.

@mergify

mergify Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.65%. Comparing base (78ce2cb) to head (2d75a71).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8436   +/-   ##
========================================
  Coverage    96.65%   96.65%           
========================================
  Files          296      296           
  Lines        14885    14885           
  Branches      1263     1263           
========================================
  Hits         14387    14387           
  Misses         363      363           
  Partials       135      135           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena
leandrodamascena merged commit 4810265 into aws-powertools:develop Sep 14, 2026
15 checks passed
@boring-cyborg

boring-cyborg Bot commented Sep 14, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

@powertools-for-aws-oss-automation

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

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

2 participants