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

Error when reading datapackage.json with external schema #25

Open
peterdesmet opened this issue Sep 28, 2020 · 0 comments
Open

Error when reading datapackage.json with external schema #25

peterdesmet opened this issue Sep 28, 2020 · 0 comments
Labels

Comments

@peterdesmet
Copy link
Member

Overview

I'm trying to read a data package where the tabular-data-resource schema is defined in an external data file, but I am getting an Error: $ operator is invalid for atomic vectors. The datapackage.json is valid when I check with other validators.

Reproducible example:

  1. Create local directory periodic_table with a data package containing the periodic table (copied from https://github.com/frictionlessdata/examples/tree/master/periodic-table)
  2. Read and validate package:
package <- Package.load(read_json("periodic_table/datapackage.json"))
package$valid
[1] TRUE
  1. So far so good. Change the datapackage.json so that the schema is an external json file:
{
  "name": "period-table",
  "title": "Periodic Table",
  "profile": "tabular-data-package",
  "licenses": [{
    "id": "CC0-1.0",
    "title": "CC0 1.0",
    "url": "https://creativecommons.org/publicdomain/zero/1.0/"
  }],
  "resources": [{
    "path": "data.csv",
    "name": "data",
    "profile": "tabular-data-resource",
    "format": "csv",
    "mediatype": "text/csv",
    "encoding": "UTF-8",
    "schema": "https://gist.githubusercontent.com/peterdesmet/10725a8f66fc821456abd5b52692d0f6/raw/7b21d5335aeb4a8603f60a1342d02b0bf5a5e95d/schema.json"
  }]
}
  1. Read again:
package <- Package.load(read_json("periodic_table/datapackage.json"))
Error: $ operator is invalid for atomic vectors

Any idea what might be causing this?


Please preserve this line to notify @kleanthisk10 (lead of this repository)

@roll roll added the bug label Sep 28, 2020
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

2 participants