You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems that the behavior of the // operator has changed between 4.45.2 and 4.45.3. I have been wondering why my expression failed with the newer version (I upgraded from 4.45.1 to 4.45.4) and tried around a lot. This is what I found.
Version of yq: 4.45.3 and 4.45.4
Operating system: Mac
Installed via: brew and docker
Note that '.[] | (select(.foo) | {.foo} // {})' yields a result in all versions, but '.[] | (select(.foo) | {"foo": .foo} // {})' doesn't in versions 4.45.3 onwards.
The text was updated successfully, but these errors were encountered:
Describe the bug
It seems that the behavior of the
//
operator has changed between 4.45.2 and 4.45.3. I have been wondering why my expression failed with the newer version (I upgraded from 4.45.1 to 4.45.4) and tried around a lot. This is what I found.Version of yq: 4.45.3 and 4.45.4
Operating system: Mac
Installed via: brew and docker
Input Yaml
data.yml
Command
The command you ran:
Actual behavior
no output
Expected behavior
Additional context
I wrote the following script to test this on multiple versions easily:
Note that
'.[] | (select(.foo) | {.foo} // {})'
yields a result in all versions, but'.[] | (select(.foo) | {"foo": .foo} // {})'
doesn't in versions 4.45.3 onwards.The text was updated successfully, but these errors were encountered: