Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(convert): do not return error when converting zero to float #1

Closed
wants to merge 2 commits into from

Conversation

PetrHeinz
Copy link

@PetrHeinz PetrHeinz commented Dec 5, 2024

Summary

Fixes a little edge case of to_float("0") returning an error. While 0 is not normal, it's commonly used in data parsed by Vector, and should not trigger an error.

This change will not re-introduce vectordotdev#1107 which was the main reason behind the original fix in vectordotdev#1108.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

Modified the tests

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Checklist

  • Our CONTRIBUTING.md is a good starting place.
  • If this PR introduces changes to LICENSE-3rdparty.csv, please
    run dd-rust-license-tool write and commit the changes. More details here.
  • For new VRL functions, please also create a sibling PR in Vector to document the new function.

References

@PetrHeinz
Copy link
Author

Sorry for the brevity, just tried to suggest a quick fix through the web GUI 🙌

No worries if not up to the contrib-guide and gets closed 🤷

@PetrHeinz
Copy link
Author

Original pr introducing the validation was reverted in vectordotdev#1179

@PetrHeinz PetrHeinz closed this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function to_float fails to parse "0": Invalid float "0": not a normal f64 number
1 participant