obi import: fixed bugs when rewriting a column: a bug with new elements

names ignoring previous elements names found, a bug with the global
obi_errno being reset too late, and a bug with the column dictionary
used by obi import not being updated after rewriting a column
This commit is contained in:
Celine Mercier
2017-07-07 15:33:43 +02:00
parent 906343187b
commit 740d021276

View File

@ -248,7 +248,7 @@ def run(config):
if value_type == dict : # Check dictionary keys
for k in value :
if k not in old_elements_names :
new_elements_names = list(value)
new_elements_names = list(set(old_elements_names+[tobytes(k) for k in value]))
rewrite = True
break
@ -263,14 +263,18 @@ def run(config):
if new_nb_elements_per_line == 0 and new_elements_names is not None :
new_nb_elements_per_line = len(new_elements_names)
# Reset obierrno
obi_errno = 0
dcols[tag] = (view.rewrite_column_with_diff_attributes(old_column.name,
new_data_type=new_type,
new_nb_elements_per_line=new_nb_elements_per_line,
new_elements_names=new_elements_names),
value_obitype)
# Reset obierrno
obi_errno = 0
# Update the dictionary:
for t in dcols :
dcols[t] = (view[t], dcols[t][1])
# Fill value
dcols[tag][0][i] = value