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

Casting/validation gives unexpected errors #72

Closed
Mikanebu opened this issue Jun 14, 2017 · 11 comments
Closed

Casting/validation gives unexpected errors #72

Mikanebu opened this issue Jun 14, 2017 · 11 comments
Assignees
Labels

Comments

@Mikanebu
Copy link

Mikanebu commented Jun 14, 2017

Here are a couple of errors that I think, probably a bug

Also, when I got an error message, it was not clear:

  • Wrong type for header: Coordinates and value: -14.27667
    Suggestion: Coordinates field cannot accept value -14.27667. Geopoint type should be in the pattern "lon, lat".
  • Row X is completely blank { "error-count": 1, "headers": [ "Country Name", "Country Code", "Year", "Value" ], "time": 0.406, "row-count": 1000, "source": "gdp/data/gdp.csv", "valid": false }
    This error message has unnecassary information and not clear.
    Suggestion: Row X is completely blank. According to the spec it cannot be accept empty rows. Path to source
  • Row 7 is duplicated to row(s) 6
    Same here
  • When schema type is not type of *array*.
    Too much information and not clear.
    Suggestion: Failed validating 'type' in schema['properties']['sources']. Sources property type must be type of array.
  • AttributeError: 'list' object has no attribute 'split'
    Wrong geotype error which is not clear.
    Probably it is kind of bug
@roll
Copy link
Member

roll commented Jun 14, 2017

@Mikanebu
Hi. Thank you for the report. Could you please write tableschema library version.

@roll roll self-assigned this Jun 14, 2017
@Mikanebu
Copy link
Author

Mikanebu commented Jun 14, 2017

@roll 0.2.2 - jsontableschema
1.0.0-alpha.7 - table schema

@rufuspollock
Copy link
Contributor

@Mikanebu could you link files / data packages where these errors arise in your description.

@Mikanebu
Copy link
Author

Mikanebu commented Jun 14, 2017

@rufuspollock Spreadsheet for the broken data packages:( Sheet1 has all the errors we fixed, in Sheet2, rows 2-14 have an errors abovementioned)
https://docs.google.com/spreadsheets/d/14kJluhePaMOx6vYBic0poVjDYK3I8-v_xF3sv4Focac/edit#gid=1881654332&range=2:14

@Mikanebu
Copy link
Author

@roll I updated issue by providing with exact csv file location, the spreadsheet that I abovementioned is really confusing. If you have any questions, let me know

@roll roll added planned and removed current labels Jun 15, 2017
@roll roll added this to the Version-1 milestone Jun 15, 2017
@rufuspollock
Copy link
Contributor

@roll do you know when you might be able to confirm these are bugs and, if so, fix them? We have an upstream dependency on this and it would be great to see them fixed 😄

@roll
Copy link
Member

roll commented Jun 16, 2017

@Mikanebu
@rufuspollock
It's a bug. I'll fix it Monday/Tuesday.

@roll roll added current and removed planned labels Jun 16, 2017
@roll roll removed this from the Version-1 milestone Jun 19, 2017
@roll
Copy link
Member

roll commented Jun 20, 2017

I'm on it but seems will release tomorrow not today. @Mikanebu thanks for error message suggestions. I'll integrate it.

@roll
Copy link
Member

roll commented Jun 21, 2017

@Mikanebu could you help here with exact failing code example. I can't reproduce it:

when "type: string" in resource schema, values in form of numbers give an error. E.g.:
Wrong type for header: territory and value: 001
It is erroring for both values 001 and "001".
https://github.com/datasets/language-codes/blob/master/data/ietf-language-tags.csv

// tableschema@1.0.0-alpha.7
const schema = {
  fields: [
    {
      name: 'lang',
      description: 'IANA/Unicode language-tag-extension',
      type: 'string'
    },
    {
      name: 'langtype',
      description: 'ISO 2 letter alpha-2 language code',
      type: 'string'
    },
    {
      name: 'territory',
      description: 'ISO3166-1-Alpha-2 country code',
      type: 'string'
    },
    {
      name: 'revgendate',
      description: 'revision date (format ISO data)',
      type: 'string'
    },
    {
      name: 'defs',
      description: 'number of definitions',
      type: 'integer'
    },
    {
      name: 'dftlang',
      description: 'indicate the default-language, as unicode-cldr',
      type: 'boolean'
    },
    {
      name: 'file',
      description: 'file-name of the locale descriptor',
      type: 'string'
    }
  ]
}
const data = 'https://raw.githubusercontent.com/datasets/language-codes/master/data/ietf-language-tags.csv'
new tableschema.Table(schema, data).then(async (table) => {
  const rows = await table.read()
  console.log(rows) // all good
})

@roll
Copy link
Member

roll commented Jun 21, 2017

@Mikanebu I would say it's not a valid geopoint according to the specs: A string of the pattern "lon, lat", where lon is the longitude and lat And https://github/datasets/airport-codes/ has geopoints in "lat, lon" format (reverse order). So a latitude with a value -151.6959991 is invalid.

geopoint type is not working well. It gives an error even though it has a valid format according to the spec. For example, “59.94919968, -151.6959991”:
"Wrong type for header: coordinates and value: 59.94919968, -151.6959991"
https://raw.githubusercontent.com/datasets/airport-codes/master/data/airport-codes.csv

@roll
Copy link
Member

roll commented Jun 21, 2017

CLOSED in favor of:

Please open new issue if you still experience problems with type: string. But please add a code causing the issue (can't reproduce).

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

No branches or pull requests

3 participants