#2848·yq

*? merge operator seems to be broken in 4.53.6 if left-hand side is constructed

Author: march-githubCreated Aug 31, 2026Updated Aug 31, 2026
Labelsbugv4

Describe the bug

The *? operator ("only merge existing fields") produces an empty object if the object on the left-hand side of the merge was constructed using the assignment operator. This used to work correctly through at least 4.44.1.

bash
$ yq -n '({} | .a.b=3)'
a:
  b: 3

$ yq '({} | .a.b=3) *? .' - <<EOF
a:
  b: 1
  c: 2
EOF
{}
$ #^- expected .a.b to be set to 1

$ yq --version
yq (https://github.com/mikefarah/yq/) version v4.53.6

Version of yq: 4.53.6 Operating system: linux Installed via: binary release