Skip to content
Snippets Groups Projects
Commit fe59dca0 authored by Tobias Schmidt's avatar Tobias Schmidt
Browse files

TableClass: extending table works properly with non-matching column names

parent 22544777
Branches
Tags
No related merge requests found
......@@ -1758,12 +1758,13 @@ class Table(object):
# check that column types are the same in current and new table
for name in self.col_names:
curr_type = self.col_types[self.GetColIndex(name)]
new_type = tab.col_types[tab.GetColIndex(name)]
if curr_type!=new_type:
raise TypeError('cannot extend table, column %s in new '%name +\
'table different type (%s) than in '%new_type +\
'current table (%s)'%curr_type)
if name in tab.col_names:
curr_type = self.col_types[self.GetColIndex(name)]
new_type = tab.col_types[tab.GetColIndex(name)]
if curr_type!=new_type:
raise TypeError('cannot extend table, column %s in new '%name +\
'table different type (%s) than in '%new_type +\
'current table (%s)'%curr_type)
num_rows = len(tab.rows)
for i in range(0,num_rows):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment