Commit db77fdb3 authored by Pierre Dittgen's avatar Pierre Dittgen

Fix header display and delimiter warning

parent e282b0d3
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<table class="table-sm table-bordered table-striped table-hover"> <table class="table-sm table-bordered table-striped table-hover">
<thead class="thead-light"> <thead class="thead-light">
<th scope="col">1</th> <th scope="col">1</th>
{% for h in report.table.headers %} {% for h in source_data.header %}
<th scope="col" data-toggle="popover" title="{{ report.table.headers_title[loop.index - 1] }}" data-content="{{ report.table.headers_description[loop.index - 1]}}">{{ <th scope="col" data-toggle="popover" title="{{ report.table.headers_title[loop.index - 1] }}" data-content="{{ report.table.headers_description[loop.index - 1]}}">{{
h }}</th> h }}</th>
{% endfor %} {% endfor %}
......
...@@ -96,5 +96,6 @@ class ValidatorHelper: ...@@ -96,5 +96,6 @@ class ValidatorHelper:
schema=sc_info['schema'], schema=sc_info['schema'],
pre_checks_conf=pre_checks_conf, pre_checks_conf=pre_checks_conf,
checks=checks, checks=checks,
force_strings=True,
**{k: v for k, v in args.items() if k != 'source'} **{k: v for k, v in args.items() if k != 'source'}
) )
...@@ -32,15 +32,15 @@ def extract_source_data(source: ValidataSource, preview_rows_nb=5): ...@@ -32,15 +32,15 @@ def extract_source_data(source: ValidataSource, preview_rows_nb=5):
rows = [] rows = []
nb_rows = 0 nb_rows = 0
delimiter = None options = {}
if source.format == "csv": if source.format == "csv":
delimiter = csv_helpers.detect_dialect(source.data, format=source.format, scheme=source.scheme, options['delimiter'] = csv_helpers.detect_dialect(source.data, format=source.format, scheme=source.scheme,
custom_loaders=custom_loaders).delimiter custom_loaders=custom_loaders).delimiter
with tabulator.Stream(source.data, format=source.format, scheme=source.scheme, custom_loaders=custom_loaders, with tabulator.Stream(source.data, format=source.format, scheme=source.scheme, custom_loaders=custom_loaders,
delimiter=delimiter) as stream: **options) as stream:
for row in stream: for row in stream:
if header is None: if header is None:
header = row header = ['' if v is None else v for v in row]
else: else:
rows.append(list(map(stringify, row))) rows.append(list(map(stringify, row)))
nb_rows += 1 nb_rows += 1
......
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