Commit e6c455f6 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Fix table preview to limit rows nb

parent a8e48493
......@@ -11,7 +11,7 @@
{% for row in source_data.data_rows %}
{% for row in source_data.preview_rows %}
{% for val in row %}
<td>{{ val }}</td>
......@@ -43,10 +43,12 @@ def extract_source_data(source: ValidataSource, preview_rows_nb=5):
rows.append(list(map(stringify, row)))
nb_rows += 1
preview_rows_nb = min(preview_rows_nb, nb_rows)
return {'header': header,
'data_rows': rows,
'rows_nb': nb_rows,
'preview_rows_nb': min(preview_rows_nb, nb_rows)}
'data_rows': rows,
'preview_rows_nb': preview_rows_nb,
'preview_rows': rows[:preview_rows_nb]}
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