scraperwiki / spreadsheet-upload-tool

A ScraperWiki tool for uploading structured data from a CSV or Excel spreadsheet
3 stars 5 forks source link

"inconsistent data types" given when it's just some percentage blank. #14

Closed drj11 closed 11 years ago

drj11 commented 11 years ago

I think the "inconsistent data types" error is supposed to ignore empty cells in a column, but it does not:

Year,Awesomeness,Weather,Comment
2003,7,wet,
2004,7,wet,
2005,7,wet,
2006,7,wet,
2007,7,wet,cloud
2008,7,wet,cloud
2009,7,wet,cloud
2010,9,cold,cloud
2011,10,cold,snow
2012,8,rainy,cloud
2013,11,cold,
drj11 commented 11 years ago

Turns out that it erroneously considers the empty type, and trips this error when the number of empty cells is > 0.8 * number of non-empty cells and < the number of non-empty cells. (so in the above example the number of non-empties is 6, the number of empties is 5, which is about 83%, changing the empties by one either way make the bug go away.)

drj11 commented 11 years ago

Fixed by https://github.com/scraperwiki/spreadsheet-upload-tool/commit/976bbe2858bc6d9060174beef90da0b2eda1cdf2