Skip to content

Splatting an empty array results in execution of subsequent operators #2384

Open
@danwatford

Description

@danwatford

Describe the bug
When splatting an empty array, it is expected that subsequent operators in a pipeline are not processed, however when testing with v4.45.4, we find that subsequent operators are being executed.

Version of yq: 4.45.4
Operating system: Linux (RHEL 9.5)
Installed via: wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq

Command

yq --null-input --output-format json '[] | .[] | "start-" + . + "-end"'

Actual behavior
Outputs:

"start-"

Expected behavior

No output was expected

Additional context
Expected behaviour was observed with version 4.44.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions