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

Add parse_float() VRL function #484

Merged
merged 4 commits into from
Oct 10, 2023
Merged

Conversation

Leo1003
Copy link
Contributor

@Leo1003 Leo1003 commented Sep 30, 2023

New VRL function parse_float() to parse float string. Using f64::from_str() in the standard library as underlying implementation.

Close #266

@pront pront self-requested a review October 3, 2023 13:06
Copy link
Contributor

@pront pront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Leo1003, thank you for this PR!
It looks good overall. Left a couple a comments.

want: Err("NaN number not supported".into()),
tdef: TypeDef::float().fallible(),
}
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add two cases for MAX and MIN. Since these special values tend to be a common source of bugs.

src/stdlib/parse_float.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@pront pront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this contribution @Leo1003!

@pront pront enabled auto-merge October 10, 2023 18:56
CHANGELOG.md Show resolved Hide resolved
@pront pront added this pull request to the merge queue Oct 10, 2023
Merged via the queue into vectordotdev:main with commit b993cfd Oct 10, 2023
9 checks passed
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.

Add function to parse float
2 participants