From 1cd04d9315b14d17a8db354eb1c0a51e7864dc95 Mon Sep 17 00:00:00 2001 From: Pierre Dittgen Date: Mon, 1 Oct 2018 09:27:51 +0200 Subject: [PATCH] Wrong column delimiter becomes Invalid column delimiter --- validata_ui_next/views.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/validata_ui_next/views.py b/validata_ui_next/views.py index 2e615d7..5496483 100644 --- a/validata_ui_next/views.py +++ b/validata_ui_next/views.py @@ -70,7 +70,7 @@ ERR_CODE_TO_CONTEXT = dict([ ('minimum-constraint', 'body'), # TODO: get it from validata_validate - ('wrong-column-delimiter', 'table') + ('invalid-column-delimiter', 'table') # Custom checks fall in default case: body ]) @@ -121,6 +121,11 @@ def create_validata_report(goodtables_report): rows = [] current_row_id = 0 for err in report['table']['errors']['body']: + if not 'column-number' in err: + # TODO: handle blank row + print("No column-number problem", err) + continue + row_id = err['row-number'] del err['row-number'] del err['context'] @@ -142,7 +147,7 @@ def validate(schema_code, source, source_type): validata_report = create_validata_report(goodtables_report) - # return jsonify(better_report) + # return jsonify(validata_report) source_data = extract_source_data(source) -- GitLab