Gapminder / ddf-validation

How do you know your DDF dataset is ✅valid?
https://open-numbers.github.io/ddftools.html
GNU General Public License v3.0
7 stars 2 forks source link

UNEXPECTED_DATA rule providing #67

Closed buchslava closed 8 years ago

buchslava commented 8 years ago

UNEXPECTED_DATA

test/fixtures/rules-cases/unexpected-data

An issue according to this rule will be fired when filename and header are good but content isn't: content

ddf--concepts.csv

concept,concept_type,domain,name
name,string,,
geo,entity_domain,,
region,entity_set,geo,Region
country,entity_set,geo,Country
capital,entity_set,geo,Capital
pop,measure,geo,Population
year,time,,year
ddf--concepts.csv

concept,concept_type,domain,name
foo
geo,entity_domain,,
when dataset is correct
  any issue should NOT be found for this rule
when dataset is NOT correct
  issues in accordance with wrong lines (records) quantity should be detected for this rule
  output data for any issue should be expected

content of line or incorrect record

next refactoring should be expected: create common library with rules functions for cross rule using!

jheeffer commented 8 years ago

This is more test for invalid csv, no? You could use csvlint for this maybe? https://libraries.io/npm/csvlint

buchslava commented 8 years ago

@jheeffer sure, I'll apply it, tnx