Skip to content

Commit d7a418f

Browse files
committed
[OpenDataServices/cove#1030] Don't split text value of xml array
1 parent 8d3d32e commit d7a418f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

flattentool/input.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,14 @@ def unflatten_main_with_parser(parser, line, timezone, xml, id_name):
740740
continue
741741

742742
value = cell.cell_value
743-
converted_value = convert_type(current_type or '', value, timezone)
743+
if xml and current_type == 'array':
744+
# In xml "arrays" can have text values, if they're the final element
745+
# However the type of the text value itself should not be "array",
746+
# as that would split the text on commas, which we don't want.
747+
# https://github.com/OpenDataServices/cove/issues/1030
748+
converted_value = convert_type('', value, timezone)
749+
else:
750+
converted_value = convert_type(current_type or '', value, timezone)
744751
cell.cell_value = converted_value
745752
if converted_value is not None and converted_value != '':
746753
if xml:

0 commit comments

Comments
 (0)