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
3b7b289d
Commit
3b7b289d
authored
Jan 22, 2021
by
Pierre Dittgen
Browse files
Fix source rows count display
parent
d616897d
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_ui/views.py
View file @
3b7b289d
...
...
@@ -197,7 +197,7 @@ def build_ui_errors(errors):
return
list
(
map
(
improve_err
,
errors
))
def
create_validata_ui_report
(
validata_core_report
,
schema_dict
):
def
create_validata_ui_report
(
rows_count
:
int
,
validata_core_report
,
schema_dict
):
"""Creates an error report easier to handle and display in templates:
- only one table
- errors are contextualized
...
...
@@ -218,7 +218,7 @@ def create_validata_ui_report(validata_core_report, schema_dict):
# source dimension
ui_report
[
"table"
][
"col_count"
]
=
len
(
headers
)
ui_report
[
"table"
][
"row_count"
]
=
v_report
.
table
[
"stats"
][
"rows"
]
ui_report
[
"table"
][
"row_count"
]
=
rows_count
# Computes column info from schema
fields_dict
=
{
...
...
@@ -349,6 +349,7 @@ def validate(schema_instance: SchemaInstance, validata_resource: ValidataResourc
# Parse source data once
header
,
rows
=
validata_resource
.
extract_tabular_data
()
rows_count
=
len
(
rows
)
# Call validata_core with parsed data
validata_core_report
=
validata_core
.
validate
(
...
...
@@ -397,7 +398,9 @@ def validate(schema_instance: SchemaInstance, validata_resource: ValidataResourc
report_datetime
=
datetime
.
fromisoformat
(
validata_core_report
[
"date"
]).
astimezone
()
# create ui_report
ui_report
=
create_validata_ui_report
(
validata_core_report
,
schema_instance
.
schema
)
ui_report
=
create_validata_ui_report
(
rows_count
,
validata_core_report
,
schema_instance
.
schema
)
# Display report to the user
validator_form_url
=
compute_validation_form_url
(
...
...
Pierre Dittgen
@pdi
mentioned in issue
#85 (closed)
·
Jan 22, 2021
mentioned in issue
#85 (closed)
mentioned in issue #85
Toggle commit list
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