Skip to content
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

Unexpected output order for ( a, b, ... ) expression #1847

Open
vaab opened this issue Nov 3, 2023 · 1 comment
Open

Unexpected output order for ( a, b, ... ) expression #1847

vaab opened this issue Nov 3, 2023 · 1 comment
Labels

Comments

@vaab
Copy link
Contributor

vaab commented Nov 3, 2023

Describe the bug

Version of yq: 4.35.2
Operating system: linux
Installed via: compiled from latest source

Input Yaml
data.yml:

- a: a1
  b: b1
- a: a2
  b: b2

Command

yq '.[] | (.a , .b)' data.yml

Actual behavior

a1
a2
b1
b2

Expected behavior

a1
b1
a2
b2

Note that jq works like the expected behavior.

@vaab
Copy link
Contributor Author

vaab commented Nov 3, 2023

workaround:

yq '.[] | [.a ,.b] | .[]' /tmp/test.yaml 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant