Commit 42c66041 authored by Pierre Dittgen's avatar Pierre Dittgen

Stringify cell value to resolve Excel issue

parent 00610080
......@@ -18,6 +18,13 @@ import tabulator
def extract_source_data(source, preview_rows_nb=5):
""" Computes table preview """
def stringify(val):
""" Transform value into string """
if val is None:
return ''
return str(val)
header = None
rows = []
nb_rows = 0
......@@ -26,7 +33,7 @@ def extract_source_data(source, preview_rows_nb=5):
if header is None:
header = row
else:
rows.append(row)
rows.append(list(map(stringify, row)))
nb_rows += 1
return {'header': header,
'data_rows': 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