Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alexandre Bulté
Validata Core
Commits
45e962fa
Commit
45e962fa
authored
Dec 03, 2018
by
Christophe Benz
Browse files
Merge goodtables spec.json with validata one
parent
7eff80b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
validata_core/__init__.py
View file @
45e962fa
...
...
@@ -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
=
","
...
...
validata_core/spec.py
0 → 100644
View file @
45e962fa
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"
]})
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment