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
Validata
Validata UI
Commits
1a2ecbe2
Commit
1a2ecbe2
authored
Nov 20, 2018
by
Pierre Dittgen
Browse files
Simplifying ValidateHelper
parent
2a8cabca
Changes
1
Show whitespace changes
Inline
Side-by-side
validata_ui/validate_helper.py
View file @
1a2ecbe2
...
...
@@ -82,20 +82,14 @@ class ValidatorHelper:
sc_info
=
cls
.
schema_dict
[
schema_code
]
# Build checks configuration
checks
=
[
'structure'
,
'schema'
]
pre_checks_conf
=
None
if
'goodtables_checks'
in
sc_info
:
c_checks
=
sc_info
[
'goodtables_checks'
]
if
'custom_checks'
in
c_checks
:
for
check_conf
in
c_checks
[
'custom_checks'
]:
checks
.
append
({
check_conf
[
'name'
]:
check_conf
[
'params'
]})
pre_checks_conf
=
c_checks
.
get
(
'pre_checks'
)
pre_checks_conf
=
sc_info
[
'goodtables_checks'
].
get
(
'pre_checks'
)
return
validate
(
source
=
args
[
'source'
],
schema
=
sc
_info
[
'schema'
]
,
schema
=
sc
hema_code
,
pre_checks_conf
=
pre_checks_conf
,
checks
=
checks
,
force_strings
=
True
,
**
{
k
:
v
for
k
,
v
in
args
.
items
()
if
k
!=
'source'
}
)
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