-
Notifications
You must be signed in to change notification settings - Fork 33
parse.number('') should return null, not 0 #524
Comments
Blank fields in CSVs are |
An option passed to |
From a data point of view, this is a tough question. In an HTML table, it's already hard to convince yourself that an empty column really means zero. If they know there are no deaths, they would type zero, right? If they don't know how many deaths they have, then why would they add a death column? In a CSV, you can bet your bottom dollar that an empty column could very well mean they don't have data. ArcGIS CSVs are a perfect example of that, they're often littered with fields in some archaic database that no one has any clue about. The same will happen with any API endpoint that is accessing such a database. And sources that give us a field = 0... do we know what standard they use? Does zero mean zero or not tracking? I think at the end-user consumption level, we should at the very least say "zero may mean there is no data reported" |
And at a data collection level we probably want to distinguish between we have data of zero or we have no data. 👍 |
Description
/title
Steps to reproduce
parse.number('')
Expected behavior
It's null?
Additional context
This is a tough one. It seems like it should return null, which will cause a validation error, and if the scraper author wants to return zero for empty string, they can explicitly do:
parse.number(parse.string(whatever) || 0)
The text was updated successfully, but these errors were encountered: