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.

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.

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.

2 participants