Commit 45e962fa authored by Christophe Benz's avatar Christophe Benz
Browse files

Merge goodtables spec.json with validata one

parent 7eff80b6
......@@ -9,11 +9,12 @@ import importlib_resources
import requests
import toml
from tableschema import Schema
from toolz import thread_first, update_in
from toolz import get_in, thread_first, update_in
import goodtables
from . import csv_helpers, loaders, messages
from .spec import spec
log = logging.getLogger(__name__)
......@@ -197,7 +198,7 @@ class Validator:
report = inspector.inspect(source=source, schema=schema_descriptor, **options)
if report['tables'][0]['format'] == "csv" and not any(
err['type'] == 'source'
get_in(['errors', err['code'], 'type'], spec, default=None) == 'source'
for err in report['tables'][0]['errors']
):
scdl_delimiter = ","
......
import json
import importlib_resources
from toolz import update_in
import goodtables
def _load_spec():
with importlib_resources.path('validata_core', 'validata_spec.json') as path:
with path.open() as fp:
return json.load(fp)
validata_spec = _load_spec()
spec = update_in(goodtables.spec, ['errors'], lambda errors: {**errors, **validata_spec["errors"]})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment