Skip to content

Conversation

@jbristow
Copy link
Contributor

Currently jmespath value providers return only the first item in a list. This causes a lot of confusion, and this PR attempts to address it.

@codecov
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.21%. Comparing base (c433dbf) to head (a047d3a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #407   +/-   ##
=======================================
  Coverage   98.21%   98.21%           
=======================================
  Files         152      152           
  Lines        5986     5989    +3     
=======================================
+ Hits         5879     5882    +3     
  Misses        107      107           
Flag Coverage Δ
3.10-macos-latest 98.19% <100.00%> (+0.01%) ⬆️
3.10-ubuntu-latest 98.18% <100.00%> (+<0.01%) ⬆️
3.10-windows-latest 98.18% <100.00%> (+<0.01%) ⬆️
3.11-macos-latest 98.19% <100.00%> (+<0.01%) ⬆️
3.11-ubuntu-latest 98.18% <100.00%> (+<0.01%) ⬆️
3.11-windows-latest 98.18% <100.00%> (+<0.01%) ⬆️
3.12-macos-latest 98.18% <100.00%> (-0.02%) ⬇️
3.12-ubuntu-latest 98.18% <100.00%> (+<0.01%) ⬆️
3.12-windows-latest 98.18% <100.00%> (+<0.01%) ⬆️
3.13-macos-latest 98.18% <100.00%> (+<0.01%) ⬆️
3.13-ubuntu-latest 98.18% <100.00%> (+<0.01%) ⬆️
3.13-windows-latest 98.18% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

return None
if len(result) == 1:
return result[0]
return list(result)
Copy link
Contributor

Choose a reason for hiding this comment

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

Conversation with Jon, the code for single value and search should be merged to have direct identification of whether the data is coming in as a list and using that knowledge to determine how to send the data. (directly return the raw_search). Develop something akin of a !pluck provider that takes the first entry when encountering a list as a single value to replace the prior functionality.

@zprobst zprobst changed the base branch from main to 0.15 October 3, 2025 13:34
@cbadke
Copy link

cbadke commented Oct 10, 2025

I would very much like to +1 the need to have the jmespath provider support setting lists to properties instead of just pulling the first value from the array.

@jbristow
Copy link
Contributor Author

I would very much like to +1 the need to have the jmespath provider support setting lists to properties instead of just pulling the first value from the array.

Hey! This inspires me to consider thinking about directing my copious free time to finishing this

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.

4 participants