Fix for bug with extra columns in later chunks, closes #234

Thanks @nieuwenhoven for the fix, proposed in #225
This commit is contained in:
Simon Willison 2021-02-14 13:03:17 -08:00
commit 8f042ae1fd
2 changed files with 20 additions and 6 deletions

View file

@ -1904,12 +1904,10 @@ class Table(Queryable):
if hash_id:
all_columns.insert(0, hash_id)
else:
all_columns += [
column
for record in chunk
for column in record
if column not in all_columns
]
for record in chunk:
all_columns += [
column for column in record if column not in all_columns
]
validate_column_names(all_columns)
first = False