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
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Problem
When using to_float on a zero (either "0", "0.0", "0.000", ...), parsing fails with:
error[E000]: function call error for "to_float" at (142:156): NaN number not supported "Invalid float \"0\": not a normal f64 number"
┌─ :4:8
│
4 │ test = to_float!("0")
│ ^^^^^^^^^^^^^^ NaN number not supported "Invalid float \"0\": not a normal f64 number"
│
= see language documentation at https://vrl.dev
= try your code in the VRL REPL, learn more at https://vrl.dev/examples
This issue was introduced in newly released 0.43.0.
"one": "1",
"zero": "0",
"nan": "nan"
}
.zero_float, .zero_float_err = to_float(.zero)
.one_float, .one_float_err = to_float(.one)
.nan_float, .nan_float_err = to_float(.nan)
{
"nan": "nan",
"nan_float": 0,
"nan_float_err": "function call error for \"to_float\" at (120:134): NaN number not supported \"Invalid float \\\"nan\\\": not a normal f64 number\"",
"one": "1",
"one_float": 1,
"one_float_err": null,
"zero": "0",
"zero_float": 0,
"zero_float_err": "function call error for \"to_float\" at (31:46): NaN number not supported \"Invalid float \\\"0\\\": not a normal f64 number\""
}
A note for the community
Problem
When using
to_float
on a zero (either "0", "0.0", "0.000", ...), parsing fails with:This issue was introduced in newly released 0.43.0.
Configuration
No response
Version
vector 0.43.0 (aarch64-apple-darwin 88e017f 2024-12-03 22:44:54.502541095)
Debug Output
No response
Example Data
Additional Context
https://playground.vrl.dev/?state=eyJwcm9ncmFtIjoiLnplcm9fZmxvYXQsIC56ZXJvX2Zsb2F0X2VyciA9IHRvX2Zsb2F0KC56ZXJvKVxuLm9uZV9mbG9hdCwgLm9uZV9mbG9hdF9lcnIgPSB0b19mbG9hdCgub25lKVxuLm5hbl9mbG9hdCwgLm5hbl9mbG9hdF9lcnIgPSB0b19mbG9hdCgubmFuKVxuIiwiZXZlbnQiOnsib25lIjoiMSIsInplcm8iOiIwIiwibmFuIjoibmFuIn0sImlzX2pzb25sIjpmYWxzZSwiZXJyb3IiOm51bGx9
References
vectordotdev/vrl#1107
The text was updated successfully, but these errors were encountered: