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

[bugfix] {DataSource} empty numeric values became 0 and could not be cleaned #250

Merged

Conversation

AntoineYANG
Copy link
Contributor

@AntoineYANG AntoineYANG commented Dec 19, 2022

In csv-like files, empty values are read as empty strings "". Here was a bug that validation check of numeric values (quantitative or ordinal) got bypassed because the values were transformed into 0s. Prevent using Number() to transform an unknown object until you're sure that it is not "" or null because the trap where

Number("");          // 0
isNaN(Number(""));   // false
Number(null);        // 0
isNaN(Number(null)); // false

@vercel
Copy link

vercel bot commented Dec 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
rath ✅ Ready (Inspect) Visit Preview Dec 19, 2022 at 9:35AM (UTC)

@AntoineYANG AntoineYANG changed the title [fix] {datasource: empty numeric values became 0 and could not be cleaned [bugfix] {DataSource} empty numeric values became 0 and could not be cleaned Dec 19, 2022
@ObservedObserver ObservedObserver merged commit 51d1177 into master Dec 20, 2022
@AntoineYANG AntoineYANG deleted the fix-datasource-empty_numeric_became_0-ks-1219 branch December 29, 2022 02:14
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.

2 participants