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

Treat NaN and Inf as invalid #1903

Merged
merged 1 commit into from
Jun 11, 2019
Merged

Treat NaN and Inf as invalid #1903

merged 1 commit into from
Jun 11, 2019

Conversation

zerebubuth
Copy link
Member

Although these are, technically, valid floating point values, we don't really expect to see them in real input data - and they don't convey useful information about real-world features. Further, they can cause other stages of the pipeline which were written with finite numbers in mind to raise exceptions, breaking the build.

This changes the behaviour of to_float to treat NaN and Inf as if they were not valid floating point numbers, returning None instead.

Although these are, technically, valid floating point values, we don't really expect to see them in real input data - and they don't convey useful information about real-world features. Further, they can cause other stages of the pipeline which were written with finite numbers in mind to raise exceptions, breaking the build.

This changes the behaviour of `to_float` to treat `NaN` and `Inf` as if they were not valid floating point numbers, returning `None` instead.
@zerebubuth zerebubuth requested review from rmarianski and iandees June 11, 2019 10:04
Copy link
Member

@nvkelso nvkelso left a comment

Choose a reason for hiding this comment

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

LGTM

@nvkelso nvkelso added this to the v1.8.0 milestone Jun 11, 2019
@zerebubuth zerebubuth merged commit ca9a42c into master Jun 11, 2019
@zerebubuth zerebubuth deleted the zerebubuth/to-float-nan branch June 11, 2019 18:27
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.

4 participants