mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Use original column headers during imports
Summary: When possible, the original column headers from imported files will now be used as the labels for Grist columns. This includes values that were previously invalid Grist column identifiers, such as those containing Unicode. Test Plan: Updated server and browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3261
This commit is contained in:
@@ -156,8 +156,9 @@ class ImportActions(object):
|
||||
isCopyFormula = (formula.startswith("$") and formula[1:] in src_cols)
|
||||
|
||||
if gen_all or not isCopyFormula:
|
||||
#if colId specified, use that. Else label is fine
|
||||
new_col_id = _import_transform_col_prefix + (c.colId or c.label)
|
||||
# If colId specified, use that. Otherwise, use the (sanitized) label.
|
||||
col_id = c.colId or identifiers.pick_col_ident(c.label)
|
||||
new_col_id = _import_transform_col_prefix + col_id
|
||||
new_col_spec = {
|
||||
"label": c.label,
|
||||
"type": c.type,
|
||||
|
||||
Reference in New Issue
Block a user