-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect JMESPath result with text output format #8998
Comments
Thanks for reaching out. Linking relevant AWS CLI v2 documentation for reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-output-format.html As noted there, the difference in behavior between Regarding pagination, here is documentation with more information on how that works in the AWS CLI: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-pagination.html When you specify |
I understand that changing this behaviour is a breaking change and that you've said that this is expected, but from my perspective as a user this feels very unexpected. Why does changing the output format change the query behaviour rather than just changing how the output is rendered? I suppose I can close this as Won't Fix 🤷 |
Thanks for following up. I will close this as not planned as it is the expected behavior. I think this comment an older issue explains the reasoning behind the differences in behavior:
|
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
When the text output format is selected, results returned are inconsistent from the json output (and a test on jmespath.org, which is consistent with the json format).
We are running the following query:
sort_by(imageDetails[? !(contains(imageTags[0],
feature-branch))], & imagePushedAt)[-1].imageTags[0]
on anaws ecr describe-images
CLI call which ultimately results in more than one page of results being returned.Regression Issue
Expected Behavior
I expect only the latest non feature branch version to be returned; in our case, 1.0.0-49
Current Behavior
I get that query executed on every page of results returned - 1.0.0-49 plus 1.0.0-18 by default, but by configuring the
--page-size
argument I can get more results.Reproduction Steps
aws ec2 describe-images --owners amazon --query 'sort_by(Images[], & CreationDate)[-1].ImageId' --output text --page-size 100
Possible Solution
No response
Additional Information/Context
No response
CLI version used
aws-cli/2.17.42 Python/3.11.9 Darwin/23.6.0 source/arm64
Environment details (OS name and version, etc.)
MacOS Sonoma 14.7
The text was updated successfully, but these errors were encountered: