Skip to content

jq 1.6 different (incorrect?) behavior for tonumber? // tostring compared to jq 1.5 #1885

@evantorrie

Description

@evantorrie

Describe the bug
jq-1.6 behaves differently (and as I read the manual, incorrectly) when running map_values with a filter which includes an alternate //.

To Reproduce

% jq-1.5 'map_values( tonumber? // tostring)' <<< '{"fish": "food", "account": "1234"}'
{
  "fish": "food",
  "account": 1234
}
% jq-1.6 'map_values( tonumber? // tostring)' <<< '{"fish": "food", "account": "1234"}'
{
  "fish": "food"
}

Expected behavior
Expected jq-1.5 output to appear in both cases

Environment (please complete the following information):

  • MacOS Mojave
  • jq version 1.5.3 and 1.6 (poured from homebrew bottles)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions