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

Floating-Points Without Leading Digit In CSV Are Inferred As Strings #830

Closed
brianrackle opened this issue Oct 15, 2021 · 0 comments · Fixed by #831
Closed

Floating-Points Without Leading Digit In CSV Are Inferred As Strings #830

brianrackle opened this issue Oct 15, 2021 · 0 comments · Fixed by #831
Labels

Comments

@brianrackle
Copy link
Contributor

Describe the bug
infer_field_schema in csv/reader.rs will infer a string from a floating-point without a leading digit (e.g. ".2"). Numbers between 1 and 0 that don't have leading zeros and are still valid and the zero is inferred. For example, ".2" and "0.2" should be considered equivalent.

To Reproduce
Steps to reproduce the behavior:
Use infer_field_schema on any float between 1 and 0 without a leading digit, such as:
.1
.2
.3
.4
etc...

Expected behavior
A digit should not be required to proceed the decimal for a float to be inferred so that ".2" and "0.2" are equivalent and both inferred as floats.

Additional context
I only tested CSV parsing, so this bug might be present with other file formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant