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
92d9014f
Commit
92d9014f
authored
Sep 27, 2018
by
Pierre Dittgen
Browse files
Now integrates pre-checks
parent
675bf91d
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_ui_next/validate.py
View file @
92d9014f
...
...
@@ -71,7 +71,6 @@ class ValidatorHelper:
# First schema keys but 'fields'
d1
=
dict
([(
k
,
v
)
for
k
,
v
in
cls
.
schema_dict
[
schema_code
][
'schema'
].
items
()
if
k
!=
'fields'
])
print
(
'D1 ='
,
d1
)
# All keys but schema* and custom_checks*
d2
=
{
k
:
v
for
k
,
v
in
cls
.
schema_dict
[
schema_code
].
items
()
...
...
@@ -94,9 +93,15 @@ class ValidatorHelper:
# Build checks configuration
checks
=
[
'structure'
,
'schema'
]
pre_checks_conf
=
[]
if
'custom_checks'
in
sc_info
:
for
check_conf
in
sc_info
[
'custom_checks'
][
'checks'
]:
c_checks
=
sc_info
[
'custom_checks'
]
for
check_conf
in
c_checks
[
'checks'
]:
checks
.
append
({
check_conf
[
'name'
]:
check_conf
[
'params'
]})
if
'pre_checks'
in
c_checks
:
for
check_conf
in
c_checks
[
'pre_checks'
]:
pre_checks_conf
.
append
({
check_conf
[
'name'
]:
check_conf
[
'params'
]})
inspector
=
Inspector
(
checks
=
checks
,
row_limit
=
VALIDATA_MAX_ROWS
)
...
...
@@ -104,5 +109,5 @@ class ValidatorHelper:
source
=
source
,
inspector
=
inspector
,
schema
=
sc_info
[
'schema'
],
delimiter
=
','
,
pre_checks_conf
=
pre_checks_conf
,
)
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