Skip to content

Interpreter conversion of string to number should throw on NaN #27788

@w33ble

Description

@w33ble

Kibana version: 6.6+

Describe the bug:

When converting from a string to a number, it simply passes the string through Number. This mostly works, except when the resulting value is NaN, in which case it just returns NaN, which is a number, but isn't valid.

Steps to reproduce:

  1. Set an number argument to a string value, like "cats" (font size on the plot function in Canvas is one example).
  2. The value of args passed into the function is the string "NaN"

Expected behavior:

The conversion should throw if isNaN(Number(value)) is true.

Metadata

Metadata

Assignees

Labels

Feature:ExpressionLanguageInterpreter expression language (aka canvas pipeline)bugFixes for quality problems that affect the customer experiencegood first issuelow hanging fruit

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions