ValueError: cannot insert ROW_ID, already exists in CsvTableFile constructor

Description

When we pass a data frame into the constructor for CsvTableFile, it tries to convert row labels of the form "[ROW_ID]_[ROW_VERSION]" back to separate columns for row id and version. This breaks if those columns already exist:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Traceback (most recent call last): File "voice_feature_extraction.py", line 280, in <module> main() File "voice_feature_extraction.py", line 276, in main args.func(args, syn) File "voice_feature_extraction.py", line 137, in process_rows file_map = syn.downloadTableColumns(Table(schema, df_to_download), args.data_columns) File "/home/ubuntu/install/miniconda2/lib/python2.7/site-packages/synapseclient/table.py", line 769, in Table return CsvFileTable.from_data_frame(schema, values, **kwargs) File "/home/ubuntu/install/miniconda2/lib/python2.7/site-packages/synapseclient/table.py", line 1068, in from_data_frame df2.insert(0, 'ROW_ID', row_id) File "/home/ubuntu/install/miniconda2/lib/python2.7/site-packages/pandas/core/frame.py", line 2392, in insert loc, column, value, allow_duplicates=allow_duplicates) File "/home/ubuntu/install/miniconda2/lib/python2.7/site-packages/pandas/core/internals.py", line 3426, in insert raise ValueError('cannot insert %s, already exists' % item) ValueError: cannot insert ROW_ID, already exists

Environment

None

Status

Assignee

Ziming Dong

Reporter

Chris Bare

Labels

None

Validator

Kenneth Daily

Release Version History

None

Components

Fix versions

Affects versions

py-1.5

Priority

Major