Commit 6dc7f077 authored by Pierre Dittgen's avatar Pierre Dittgen

Don't display column comparison anymore

parent 2cd7cbd5
......@@ -244,32 +244,11 @@ def create_validata_ui_report(validata_core_report, schema_dict):
else:
report['table']['errors']['body'].append(err)
structure_errors = report['table']['errors']['structure']
# Always displays body errors
report['table']['do_display_body_errors'] = True
# Checks if a column comparison is needed
header_errors = ('missing-headers', 'extra-headers', 'wrong-headers-order')
structure_errors = [{**err, 'in_column_comp': err['code'] in header_errors} for err in structure_errors]
report['table']['errors']['structure'] = structure_errors
column_comparison_needed = any(err['in_column_comp'] == True for err in structure_errors)
column_comparison_table = []
if column_comparison_needed:
column_comparison_table = []
field_names = [f['name'] for f in schema_dict.get('fields', [])]
has_case_errors = False
for t in itertools.zip_longest(headers, field_names, fillvalue=''):
status = 'ok' if t[0] == t[1] else 'ko'
if not has_case_errors and status == 'ko' and t[0].lower() == t[1].lower():
has_case_errors = True
column_comparison_table.append((*t, status))
info = {}
info['table'] = column_comparison_table
info['has_missing'] = len(headers) < len(field_names)
info['has_case_errors'] = has_case_errors
report['table']['column_comparison_info'] = info
report['table']['column_comparison_needed'] = column_comparison_needed
report['table']['column_comparison_needed'] = False
# Group body errors by row id
rows = []
......
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