Commit 3b7b289d authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Fix source rows count display

parent d616897d
......@@ -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(
......
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